aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/bison/gnulib/src/xstrndup.c
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /contrib/tools/bison/gnulib/src/xstrndup.c
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/bison/gnulib/src/xstrndup.c')
-rw-r--r--contrib/tools/bison/gnulib/src/xstrndup.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/contrib/tools/bison/gnulib/src/xstrndup.c b/contrib/tools/bison/gnulib/src/xstrndup.c
index 741d5a1b05..9c490ab3e1 100644
--- a/contrib/tools/bison/gnulib/src/xstrndup.c
+++ b/contrib/tools/bison/gnulib/src/xstrndup.c
@@ -21,25 +21,25 @@
#include "xstrndup.h"
#include <string.h>
-#include <stdlib.h>
-
+#include <stdlib.h>
+
#include "xalloc.h"
-#if defined(_MSC_VER)
-static char *
-strndup(char const *s, size_t n)
-{
- size_t len = strnlen(s, n);
- char *new = malloc(len + 1);
-
- if (new == NULL)
- return NULL;
-
- new[len] = '\0';
- return memcpy(new, s, len);
-}
-#endif
-
+#if defined(_MSC_VER)
+static char *
+strndup(char const *s, size_t n)
+{
+ size_t len = strnlen(s, n);
+ char *new = malloc(len + 1);
+
+ if (new == NULL)
+ return NULL;
+
+ new[len] = '\0';
+ return memcpy(new, s, len);
+}
+#endif
+
/* Return a newly allocated copy of at most N bytes of STRING.
In other words, return a copy of the initial segment of length N of
STRING. */