Skip to content

Commit 56aac97

Browse files
lib/string/strdup/xstrndup.h: Add STRNDUP()
Signed-off-by: Alejandro Colomar <[email protected]>
1 parent ec706b4 commit 56aac97

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/string/strdup/xstrndup.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
#include "x.h"
1515

1616

17-
// Similar to strndup(3), but ensure that 's' is an array, and exit on ENOMEM.
18-
#define XSTRNDUP(s) X(strndup(s, countof(s)))
17+
// Similar to strndup(3), but ensure that 's' is an array.
18+
#define STRNDUP(s) strndup(s, countof(s))
19+
20+
// Similar to STRNDUP(), but exit on ENOMEM.
21+
#define XSTRNDUP(s) X(STRNDUP(s))
1922

2023

2124
#endif // include guard

0 commit comments

Comments
 (0)