strscpy.c
Go to the documentation of this file.
1 #include "strscpy.h"
2 #include <limits.h> /* SSIZE_MAX */
3 
4 ssize_t uv__strscpy(char* d, const char* s, size_t n) {
5  size_t i;
6 
7  for (i = 0; i < n; i++)
8  if ('\0' == (d[i] = s[i]))
9  return i > SSIZE_MAX ? UV_E2BIG : (ssize_t) i;
10 
11  if (i == 0)
12  return 0;
13 
14  d[--i] = '\0';
15 
16  return UV_E2BIG;
17 }
strscpy.h
ssize_t
intptr_t ssize_t
Definition: win.h:27
d
static const fe d
Definition: curve25519_tables.h:19
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
uv__strscpy
ssize_t uv__strscpy(char *d, const char *s, size_t n)
Definition: strscpy.c:4
SSIZE_MAX
#define SSIZE_MAX
Definition: win.h:28
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:26