=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/xmalloc.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- src/usr.bin/tmux/xmalloc.c 2016/04/04 16:19:43 1.10 +++ src/usr.bin/tmux/xmalloc.c 2016/11/17 10:06:08 1.11 @@ -1,4 +1,4 @@ -/* $OpenBSD: xmalloc.c,v 1.10 2016/04/04 16:19:43 nicm Exp $ */ +/* $OpenBSD: xmalloc.c,v 1.11 2016/11/17 10:06:08 nicm Exp $ */ /* * Author: Tatu Ylonen @@ -78,6 +78,16 @@ if ((cp = strdup(str)) == NULL) fatalx("xstrdup: %s", strerror(errno)); + return cp; +} + +char * +xstrndup(const char *str, size_t maxlen) +{ + char *cp; + + if ((cp = strndup(str, maxlen)) == NULL) + fatalx("xstrndup: %s", strerror(errno)); return cp; }