1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

tests/gpgscm: Dynamically allocate string buffer.

* tests/gpgscm/scheme-config.h (strbuff{,_size}): Make buffer dynamic.
* tests/gpgscm/scheme.c (expand_strbuff): New function.
(putcharacter): Adapt length test.
(readstrexp): Expand buffer if necessary.
(scheme_init_custom_alloc): Initialize buffer.
(scheme_deinit): Free buffer.

Patch from Thomas Munro,
https://sourceforge.net/p/tinyscheme/patches/11/

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-03-31 13:33:03 +02:00
parent 3b100da9ad
commit 8e5ad9aabd
2 changed files with 34 additions and 4 deletions

View file

@ -139,8 +139,8 @@ char linebuff[LINESIZE];
#ifndef STRBUFFSIZE
#define STRBUFFSIZE 256
#endif
char strbuff[STRBUFFSIZE];
char *strbuff;
size_t strbuff_size;
FILE *tmpfp;
int tok;
int print_flag;