Skip to content

Commit 29a07ec

Browse files
committed
strlen returns size_t
1 parent 29227a4 commit 29a07ec

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

judge/runguard.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ void error(int errnum, const char *format, ...)
229229
va_start(ap,format);
230230
sigset_t sigs;
231231
char *errstr;
232-
int errlen, errpos;
233232

234233
/*
235234
* Make sure the signal handler for these (terminate()) does not
@@ -240,14 +239,14 @@ void error(int errnum, const char *format, ...)
240239
sigprocmask(SIG_BLOCK, &sigs, nullptr);
241240

242241
/* First print to string to be able to reuse the message. */
243-
errlen = strlen(progname)+255;
242+
size_t errlen = strlen(progname)+255;
244243
if ( format!=nullptr ) errlen += strlen(format);
245244

246245
errstr = (char *)malloc(errlen);
247246
if ( errstr==nullptr ) abort();
248247

249248
sprintf(errstr,"%s",progname);
250-
errpos = strlen(errstr);
249+
size_t errpos = strlen(errstr);
251250

252251
if ( format!=nullptr ) {
253252
snprintf(errstr+errpos,errlen-errpos,": ");

0 commit comments

Comments
 (0)