Skip to content

Commit 0210784

Browse files
Minor fixes for compiler warnings
1 parent a1c8532 commit 0210784

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/dsarchive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ ds_streamproc (DataStream **streamroot, char *pathformat, const SLMSrecord *msr,
251251
}
252252
else
253253
{
254-
sl_log (1, 0, "%d: access denied, %s\n", filename, strerror (errno));
254+
sl_log (1, 0, "%s: access denied, %s\n", filename, strerror (errno));
255255
sl_strparse (NULL, NULL, &fnlist);
256256
return -1;
257257
}

src/slinktool.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ packet_handler (char *msrecord, int packet_type, int seqnum, int packet_size)
172172
double dtime; /* Epoch time */
173173
double secfrac; /* Fractional part of epoch time */
174174
time_t ttime; /* Integer part of epoch time */
175-
char timestamp[20];
175+
char timestamp[36] = {0};
176176
struct tm *timep;
177177
int archflag = 1;
178178

@@ -186,7 +186,7 @@ packet_handler (char *msrecord, int packet_type, int seqnum, int packet_size)
186186
secfrac = (double)((double)dtime - (int)dtime);
187187
ttime = (time_t)dtime;
188188
timep = localtime (&ttime);
189-
snprintf (timestamp, 20, "%04d.%03d.%02d:%02d:%02d.%01.0f",
189+
snprintf (timestamp, sizeof(timestamp), "%04d.%03d.%02d:%02d:%02d.%01.0f",
190190
timep->tm_year + 1900, timep->tm_yday + 1, timep->tm_hour,
191191
timep->tm_min, timep->tm_sec, secfrac);
192192

0 commit comments

Comments
 (0)