Skip to content

Commit

Permalink
util: expose ni_stringbuf_put function
Browse files Browse the repository at this point in the history
  • Loading branch information
mtomaschewski committed Aug 13, 2015
1 parent f452d84 commit 372ceca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/wicked/util.h
Expand Up @@ -143,6 +143,7 @@ extern void ni_var_array_list_destroy(ni_var_array_t **);
extern void ni_stringbuf_set(ni_stringbuf_t *, const char *);
extern void ni_stringbuf_init(ni_stringbuf_t *);
extern void ni_stringbuf_grow(ni_stringbuf_t *, size_t);
extern void ni_stringbuf_put(ni_stringbuf_t *, const char *, size_t);
extern void ni_stringbuf_puts(ni_stringbuf_t *, const char *);
extern void ni_stringbuf_putc(ni_stringbuf_t *, int);
extern int ni_stringbuf_printf(ni_stringbuf_t *, const char *, ...);
Expand Down
8 changes: 4 additions & 4 deletions src/util.c
Expand Up @@ -1699,8 +1699,8 @@ ni_stringbuf_grow(ni_stringbuf_t *sb, size_t len)
__ni_stringbuf_realloc(sb, len);
}

static void
__ni_stringbuf_put(ni_stringbuf_t *sb, const char *ptr, size_t len)
void
ni_stringbuf_put(ni_stringbuf_t *sb, const char *ptr, size_t len)
{
__ni_stringbuf_realloc(sb, len);

Expand All @@ -1713,14 +1713,14 @@ void
ni_stringbuf_putc(ni_stringbuf_t *sb, int cc)
{
char c = cc;
__ni_stringbuf_put(sb, &c, 1);
ni_stringbuf_put(sb, &c, 1);
}

void
ni_stringbuf_puts(ni_stringbuf_t *sb, const char *s)
{
if (s)
__ni_stringbuf_put(sb, s, strlen(s));
ni_stringbuf_put(sb, s, strlen(s));
}

int
Expand Down

0 comments on commit 372ceca

Please sign in to comment.