Skip to content

Commit

Permalink
add const qualifier to fix compile warning about xstrdup argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ecki committed Oct 8, 2013
1 parent 2356964 commit 08abda6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void *xmalloc(size_t sz)
}

/* Like strdup, but oom() instead of NULL */
char *xstrdup(char *s)
char *xstrdup(const char *s)
{
char *d = strdup(s);
if (!d)
Expand Down
2 changes: 1 addition & 1 deletion lib/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

void *xmalloc(size_t sz);
void *xrealloc(void *p, size_t sz);
char *xstrdup(char *src);
char *xstrdup(const char *src);

#define new(p) ((p) = xmalloc(sizeof(*(p))))

Expand Down

0 comments on commit 08abda6

Please sign in to comment.