|
@@ -237,7 +237,7 @@ exit_err:
|
237
|
237
|
|
238
|
238
|
int pyfcgi_logger_format_bufinit(pyfcgi_logger_format_t* fmt)
|
239
|
239
|
{
|
240
|
|
- volatile unsigned short i;
|
|
240
|
+ unsigned int i;
|
241
|
241
|
size_t pre_sz, suf_sz;
|
242
|
242
|
char *cur, pid[PYFCGI_LOG_PID_LEN];
|
243
|
243
|
fmt->buf = fmt->prefix = fmt->suffix = NULL;
|
|
@@ -320,7 +320,7 @@ int pyfcgi_logger_format_bufinit(pyfcgi_logger_format_t* fmt)
|
320
|
320
|
fmt->fields[i].len);
|
321
|
321
|
break;
|
322
|
322
|
case pyfcgi_logger_field_pid:
|
323
|
|
- snprintf(pid, PYFCGI_LOG_PID_LEN+1,
|
|
323
|
+ snprintf(pid, PYFCGI_LOG_PID_LEN,
|
324
|
324
|
PYFCGI_LOG_PID_FMT,
|
325
|
325
|
*((pid_t*)fmt->fields[i].val));
|
326
|
326
|
memcpy(cur, pid, PYFCGI_LOG_PID_LEN);
|
|
@@ -337,6 +337,10 @@ int pyfcgi_logger_format_bufinit(pyfcgi_logger_format_t* fmt)
|
337
|
337
|
cur = fmt->suffix;
|
338
|
338
|
i++;
|
339
|
339
|
}
|
|
340
|
+ else
|
|
341
|
+ {
|
|
342
|
+ break;
|
|
343
|
+ }
|
340
|
344
|
}
|
341
|
345
|
return 0;
|
342
|
346
|
}
|
|
@@ -427,7 +431,7 @@ int pyfcgi_logger_parse_field(const char** ptr, const char *start,
|
427
|
431
|
cur_field->val = (void*)pyfcgi_logger_value_facility;
|
428
|
432
|
break;
|
429
|
433
|
case pyfcgi_logger_field_pid:
|
430
|
|
- default_len = PYFCGI_LOG_PID_LEN;
|
|
434
|
+ default_len = PYFCGI_LOG_PID_LEN-1;
|
431
|
435
|
cur_field->val = &(PyFCGI_conf.context.pid);
|
432
|
436
|
break;
|
433
|
437
|
case pyfcgi_logger_field_ident:
|