projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
858b3e3
)
In log_error(), assert that ival and sval have reasonable values. There's no reason...
author
Fabian Keil
<fk@fabiankeil.de>
Mon, 26 Jul 2010 11:21:47 +0000
(11:21 +0000)
committer
Fabian Keil
<fk@fabiankeil.de>
Mon, 26 Jul 2010 11:21:47 +0000
(11:21 +0000)
errlog.c
patch
|
blob
|
history
diff --git
a/errlog.c
b/errlog.c
index
1579e74
..
41cc453
100644
(file)
--- a/
errlog.c
+++ b/
errlog.c
@@
-1,4
+1,4
@@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.10
4 2010/07/26 11:20:17
fabiankeil Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.10
5 2010/07/26 11:20:53
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
@@
-794,27
+794,10
@@
void log_error(int loglevel, const char *fmt, ...)
* Takes 2 parameters: int length, const char * string.
*/
ival = va_arg(ap, int);
* Takes 2 parameters: int length, const char * string.
*/
ival = va_arg(ap, int);
+ assert(ival >= 0);
sval = va_arg(ap, char *);
sval = va_arg(ap, char *);
- if (sval == NULL)
- {
- format_string = "[null]";
- }
- else if (ival <= 0)
- {
- if (0 == ival)
- {
- /* That's ok (but stupid) */
- tempbuf[0] = '\0';
- }
- else
- {
- /*
- * That's not ok (and even more stupid)
- */
- assert(ival >= 0);
- format_string = "[counted string lenght < 0]";
- }
- }
+ assert(sval != NULL);
+
while ((ival-- > 0) && (length < log_buffer_size - 6))
{
if (isprint((int)*sval) && (*sval != '\\'))
while ((ival-- > 0) && (length < log_buffer_size - 6))
{
if (isprint((int)*sval) && (*sval != '\\'))