Cc: Christian Göttsche <cgzones@googlemail.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
shadowlog_internal.h \
shadowmem.c \
shell.c \
+ sizeof.h \
spawn.c \
sssd.c \
sssd.h \
#include "defines.h"
#include "prototypes.h"
#include "shadowlog.h"
+#include "sizeof.h"
static uint32_t csrand_uniform32(uint32_t n);
#define SCALE DAY
#endif
-#define WIDTHOF(x) (sizeof(x) * CHAR_BIT)
-#define NITEMS(arr) (sizeof((arr)) / sizeof((arr)[0]))
-#define STRLEN(s) (NITEMS(s) - 1)
-
/* Copy string pointed by B to array A with size checking. It was originally
in lmain.c but is _very_ useful elsewhere. Some setuid root programs with
very sloppy coding used to assume that BUFSIZ will always be enough... */
#include <sys/capability.h>
#endif
#include "shadowlog.h"
+#include "sizeof.h"
struct map_range *get_map_ranges(int ranges, int argc, char **argv)
{
--- /dev/null
+/*
+ * SPDX-FileCopyrightText: 2022-2023, Alejandro Colomar <alx@kernel.org>
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+
+#ifndef SHADOW_INCLUDE_LIBMISC_SIZEOF_H_
+#define SHADOW_INCLUDE_LIBMISC_SIZEOF_H_
+
+
+#include <config.h>
+
+#include <limits.h>
+
+
+#define WIDTHOF(x) (sizeof(x) * CHAR_BIT)
+#define NITEMS(arr) (sizeof((arr)) / sizeof((arr)[0]))
+#define STRLEN(s) (NITEMS(s) - 1)
+
+
+#endif // include guard
#include <fcntl.h>
#include "alloc.h"
+#include "sizeof.h"
#ident "$Id$"
#include <netinet/in.h>
#include <arpa/inet.h> /* for inet_ntoa() */
+#include "sizeof.h"
+
#if !defined(MAXHOSTNAMELEN) || (MAXHOSTNAMELEN < 64)
#undef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 256