diff --git a/lib/util.c b/lib/util.c index 6a569b6..0397f1e 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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) diff --git a/lib/util.h b/lib/util.h index fdf1f13..b7598e8 100644 --- a/lib/util.h +++ b/lib/util.h @@ -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))))