changed returned text in noOutput to same but allocated text

it could possibly cause deallocattion problems
This commit is contained in:
Václav Šmejkal 2022-06-12 17:15:07 +02:00
parent ad15dce494
commit 86c8460615
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -1,5 +1,7 @@
#include <why2/flags.h>
#include <stdlib.h>
unsigned long getKeyLength()
{
return keyLength;
@ -12,7 +14,12 @@ inputFlags noFlags()
outputFlags noOutput(unsigned char exitCode)
{
return (outputFlags) {"", "", 0, 0, exitCode};
char *empty1 = malloc(1);
char *empty2 = malloc(1);
empty1[0] = '\0';
empty2[0] = '\0';
return (outputFlags) { empty1, empty2, 0, 0, exitCode };
}
void setKeyLength(int keyLengthNew)