Commit e86fbe04 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Replace fprintf of format-free strings with fputs.

parent f94ec83c
...@@ -1359,15 +1359,14 @@ void streamWriteContents(int streamID, char *cname) ...@@ -1359,15 +1359,14 @@ void streamWriteContents(int streamID, char *cname)
if ( cnp == NULL ) SysError(cname); if ( cnp == NULL ) SysError(cname);
fprintf(cnp, "#CDI library version %s\n", cdiLibraryVersion()); fprintf(cnp, "#CDI library version %s\n"
fprintf(cnp, "#\n"); "#\n", cdiLibraryVersion());
fprintf(cnp, "filename: %s\n", streamptr->filename);
int filetype = streamptr->filetype; int filetype = streamptr->filetype;
fprintf(cnp, "filetype: %s\n", strfiletype(filetype)); fprintf(cnp, "filename: %s\n"
"filetype: %s\n", streamptr->filename, strfiletype(filetype));
fprintf(cnp, "#\n"); fputs("#\n#grids:\n", cnp);
fprintf(cnp, "#grids:\n");
int ngrids = vlistNgrids(vlistID); int ngrids = vlistNgrids(vlistID);
for ( int i = 0; i < ngrids; i++ ) for ( int i = 0; i < ngrids; i++ )
...@@ -1379,9 +1378,7 @@ void streamWriteContents(int streamID, char *cname) ...@@ -1379,9 +1378,7 @@ void streamWriteContents(int streamID, char *cname)
fprintf(cnp, "%4d:%4d:%4d:%4d\n", i+1, gridtype, xsize, ysize); fprintf(cnp, "%4d:%4d:%4d:%4d\n", i+1, gridtype, xsize, ysize);
} }
fprintf(cnp, "#\n"); fputs("#\nvarID:code:gridID:zaxisID:tsteptype:datatype\n", cnp);
fprintf(cnp, "varID:code:gridID:zaxisID:tsteptype:datatype\n");
int nvars = vlistNvars(vlistID); int nvars = vlistNvars(vlistID);
for ( int varID = 0; varID < nvars; varID++ ) for ( int varID = 0; varID < nvars; varID++ )
...@@ -1395,9 +1392,7 @@ void streamWriteContents(int streamID, char *cname) ...@@ -1395,9 +1392,7 @@ void streamWriteContents(int streamID, char *cname)
varID+1, code, gridID, zaxisID, tsteptype, datatype); varID+1, code, gridID, zaxisID, tsteptype, datatype);
} }
fprintf(cnp, "#\n"); fputs("#\ntsID:nrecs:date:time\n", cnp);
fprintf(cnp, "tsID:nrecs:date:time\n");
int tsID = 0; int tsID = 0;
while (1) while (1)
...@@ -1416,9 +1411,7 @@ void streamWriteContents(int streamID, char *cname) ...@@ -1416,9 +1411,7 @@ void streamWriteContents(int streamID, char *cname)
break; break;
} }
fprintf(cnp, "#\n"); fputs("#\ntsID:recID:varID:levID:size:pos\n", cnp);
fprintf(cnp, "tsID:recID:varID:levID:size:pos\n");
tsID = 0; tsID = 0;
while (1) while (1)
......
Supports Markdown
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