From: Nick Bowler Date: Thu, 22 Feb 2024 02:30:23 +0000 (-0500) Subject: libcdecl: Remove glibc snprintf workaround. X-Git-Tag: v1.3~12 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/1943156e7ba5c0318a54369a52297f74bad7b5b9 libcdecl: Remove glibc snprintf workaround. Since we don't use snprintf in the library anymore, we can remove the glibc bug workaround when calling cdecl__strlcpy in the parser error handler. --- diff --git a/src/parse.y b/src/parse.y index 80801c3..87d3f45 100644 --- a/src/parse.y +++ b/src/parse.y @@ -107,13 +107,7 @@ * name strings can be used directly in error messages and there is no * need for any string processing. */ -#define yytnamerr(a, b) ( (a) ? yytnamerr_copy(a, b) \ - : strlen(b) ) - -static size_t yytnamerr_copy(char *dst, const char *src) -{ - return cdecl__strlcpy(dst, src, strlen(src)+1); -} +#define yytnamerr(a, b) ( (a) ? cdecl__strlcpy(a, b, -1) : strlen(b) ) %} %code requires {