Browse Source

Add va_end for every va_start.

Dotan Barak, dotanba at gmail dot com



git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@23 327403b1-1117-474d-bef2-5cb71233fd97
tags/json-c-0.10-20120530
Michael Clark 16 years ago
parent
commit
8cdac64ccd
4 changed files with 9 additions and 1 deletions
  1. +2
    -0
      ChangeLog
  2. +4
    -0
      debug.c
  3. +1
    -0
      linkhash.c
  4. +2
    -1
      printbuf.c

+ 2
- 0
ChangeLog View File

@@ -1,4 +1,6 @@
0.8
* Add va_end for every va_start
Dotan Barak, dotanba at gmail dot com
* Add macros to enable compiling out debug code
Geoffrey Young, geoff at modperlcookbook dot org
* Fix bug with use of capital E in numbers with exponents


+ 4
- 0
debug.c View File

@@ -51,6 +51,7 @@ void mc_abort(const char *msg, ...)
} else
#endif
vprintf(msg, ap);
va_end(ap);
exit(1);
}

@@ -66,6 +67,7 @@ void mc_debug(const char *msg, ...)
} else
#endif
vprintf(msg, ap);
va_end(ap);
}
}

@@ -79,6 +81,7 @@ void mc_error(const char *msg, ...)
} else
#endif
vfprintf(stderr, msg, ap);
va_end(ap);
}

void mc_info(const char *msg, ...)
@@ -91,4 +94,5 @@ void mc_info(const char *msg, ...)
} else
#endif
vfprintf(stderr, msg, ap);
va_end(ap);
}

+ 1
- 0
linkhash.c View File

@@ -25,6 +25,7 @@ void lh_abort(const char *msg, ...)
va_list ap;
va_start(ap, msg);
vprintf(msg, ap);
va_end(ap);
exit(1);
}



+ 2
- 1
printbuf.c View File

@@ -119,8 +119,9 @@ int sprintbuf(struct printbuf *p, const char *msg, ...)
if(size == -1 || size > 127) {
int ret;
va_start(ap, msg);
if((size = vasprintf(&t, msg, ap)) == -1) return -1;
size = vasprintf(&t, msg, ap);
va_end(ap);
if(size == -1) return -1;
ret = printbuf_memappend(p, t, size);
free(t);
return ret;


Loading…
Cancel
Save