Commit 28df1afd authored by Geoff Simmons's avatar Geoff Simmons

test_config: printing strings to files simplified

parent fa2ee3e9
......@@ -61,7 +61,7 @@ char verbose_buffer[9000];
/***** functions **************************************************************/
static char *
static const char *
getConfigContent(void)
{
int i = 0;
......@@ -96,20 +96,13 @@ static int
saveConfig(const char * fname)
{
FILE *fp;
char * content;
fp = fopen( fname, "w" );
if ( fp == NULL ) {
perror(fname);
return 4;
}
content = getConfigContent();
for (int i = 0; *(content + i) != 0; i++) {
if (EOF == putc(*(content + i), fp)) {
fclose( fp);
return 8;
}
}
fprintf(fp, getConfigContent());
fclose ( fp );
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment