Rizin
unix-like reverse engineering framework and cli tools
strscpy.c File Reference
#include "strscpy.h"
#include <limits.h>

Go to the source code of this file.

Functions

ssize_t uv__strscpy (char *d, const char *s, size_t n)
 

Function Documentation

◆ uv__strscpy()

ssize_t uv__strscpy ( char *  d,
const char *  s,
size_t  n 
)

Definition at line 25 of file strscpy.c.

25  {
26  size_t i;
27 
28  for (i = 0; i < n; i++)
29  if ('\0' == (d[i] = s[i]))
30  return i > SSIZE_MAX ? UV_E2BIG : (ssize_t) i;
31 
32  if (i == 0)
33  return 0;
34 
35  d[--i] = '\0';
36 
37  return UV_E2BIG;
38 }
lzma_index ** i
Definition: index.h:629
int n
Definition: mipsasm.c:19
static RzSocket * s
Definition: rtr.c:28
int ssize_t
Definition: sftypes.h:39
#define d(i)
Definition: sha256.c:44
#define SSIZE_MAX
Definition: win.h:28

References d, i, n, s, and SSIZE_MAX.

Referenced by getexe(), inet_ntop4(), inet_ntop6(), uv_cpu_info(), uv_exepath(), uv_fs_event_start(), uv_interface_addresses(), uv_os_uname(), uv_pipe_bind(), and uv_pipe_connect().