Browse Source

Update chck

master
Jari Vetoniemi 10 years ago
parent
commit
1b87d47353
3 changed files with 6 additions and 4 deletions
  1. +1
    -1
      bin/server.c
  2. +1
    -1
      lib/chck
  3. +4
    -2
      src/pi9_string.c

+ 1
- 1
bin/server.c View File

@ -106,7 +106,7 @@ unlink_childs(struct fs *fs, struct node *parent)
chck_iter_pool_for_each(&parent->childs, c)
unlink_nodes(parent, get_node(fs, *c));
chck_iter_pool_release(&parent->childs);
chck_iter_pool_flush(&parent->childs);
}
static bool

+ 1
- 1
lib/chck

@ -1 +1 @@
Subproject commit 7ab4f4d3c6fdb6cff15134bc261a73d1eb32877d
Subproject commit 72dc4664a5e695e53e4af48fff3a36db0f67c0e2

+ 4
- 2
src/pi9_string.c View File

@ -3,13 +3,15 @@
#include <stddef.h>
#include <stdarg.h>
#include <assert.h>
#include <chck/overflow/overflow.h>
#include "pi9_string.h"
static inline char*
ccopy(const char *str, size_t len)
{
char *cpy = calloc(1, len + 1);
assert(str);
char *cpy = chck_calloc_add_of(len, 1);
return (cpy ? memcpy(cpy, str, len) : NULL);
}
@ -56,7 +58,7 @@ pi9_string_set_varg(struct pi9_string *string, const char *fmt, va_list args)
char *str = NULL;
const size_t len = vsnprintf(NULL, 0, fmt, args);
if (len > 0 && !(str = malloc(len + 1)))
if (len > 0 && !(str = chck_malloc_add_of(len, 1)))
return false;
vsnprintf(str, len + 1, fmt, cpy);

Loading…
Cancel
Save