aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_db.c
diff options
context:
space:
mode:
authorPeter Seebach <seebs@eee12.(none)>2010-03-26 13:32:57 -0500
committerPeter Seebach <seebs@eee12.(none)>2010-03-26 13:32:57 -0500
commitcaeebc0dd6ff538629687b55a5ce72554a7c3f34 (patch)
tree29f25efb21e187a4689fa3112bdd67d64b96cc96 /pseudo_db.c
parent9a95df4be5704606d88b5737b352d9ebf8ad9745 (diff)
downloadpseudo-caeebc0dd6ff538629687b55a5ce72554a7c3f34.tar.gz
pseudo-caeebc0dd6ff538629687b55a5ce72554a7c3f34.tar.bz2
pseudo-caeebc0dd6ff538629687b55a5ce72554a7c3f34.zip
Updates: Enable additional warnings, fix a number of things.
None of them seem to have been genuine problems, but it's prettier now, and some were questionable.
Diffstat (limited to 'pseudo_db.c')
-rw-r--r--pseudo_db.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pseudo_db.c b/pseudo_db.c
index ebbeb69..feda002 100644
--- a/pseudo_db.c
+++ b/pseudo_db.c
@@ -801,7 +801,7 @@ frag(buffer *b, char *fmt, ...) {
va_start(ap, fmt);
rc = vsnprintf(b->tail, b->buflen - curlen, fmt, ap);
va_end(ap);
- if (rc >= (b->buflen - curlen)) {
+ if ((rc > 0) && ((size_t) rc >= (b->buflen - curlen))) {
size_t newlen = b->buflen;
while (newlen <= (rc + curlen))
newlen *= 2;
@@ -819,7 +819,7 @@ frag(buffer *b, char *fmt, ...) {
va_start(ap, fmt);
rc = vsnprintf(b->tail, b->buflen - curlen, fmt, ap);
va_end(ap);
- if (rc >= (b->buflen - curlen)) {
+ if ((rc > 0) && ((size_t) rc >= (b->buflen - curlen))) {
pseudo_diag("tried to reallocate larger buffer, failed. giving up.\n");
return -1;
}