+2020-12-06 Bruno Haible <bruno@clisp.org>
+
+ c-stack: Use idx_t for nonnegative ptrdiff_t variables.
+ * lib/c-stack.c: Include idx.h.
+ (die): Mark buflen as nonnegative.
+ * modules/c-stack (Depends-on): Add idx.
+
2020-12-06 Bruno Haible <bruno@clisp.org>
backupfile: Use idx_t for nonnegative ptrdiff_t variables.
#include "c-stack.h"
-#include "gettext.h"
-#define _(msgid) gettext (msgid)
-
#include <errno.h>
#include <inttypes.h>
# include <stdio.h>
#endif
+#include "idx.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
/* Use libsigsegv only if needed; kernels like Solaris can detect
stack overflow without the overhead of an external library. */
#define USE_LIBSIGSEGV (!HAVE_XSI_STACK_OVERFLOW_HEURISTIC && HAVE_LIBSIGSEGV)
size_t messagelen = strlen (message);
static char const separator[] = {':', ' '};
char buf[sizeof alternate_signal_stack / 16 + sizeof separator];
- ptrdiff_t buflen;
+ idx_t buflen;
if (prognamelen + messagelen < sizeof buf - sizeof separator)
{
char *p = mempcpy (buf, progname, prognamelen);