ReactOS 0.4.15-dev-7842-g558ab78
Strncpy.c File Reference
#include <sys/types.h>
#include <string.h>
#include "Strn.h"
Include dependency graph for Strncpy.c:

Go to the source code of this file.

Functions

charStrncpy (char *const dst, const char *const src, const size_t n)
 

Function Documentation

◆ Strncpy()

char * Strncpy ( char *const  dst,
const char *const  src,
const size_t  n 
)

Definition at line 11 of file Strncpy.c.

12{
13 register char *d;
14 register const char *s;
15 register size_t i;
16
17 d = dst;
18 *d = 0;
19 if (n != 0) {
20 s = src;
21 /* If they specified a maximum of n characters, use n - 1 chars to
22 * hold the copy, and the last character in the array as a NUL.
23 * This is the difference between the regular strncpy routine.
24 * strncpy doesn't guarantee that your new string will have a
25 * NUL terminator, but this routine does.
26 */
27 for (i=1; i<n; i++) {
28 if ((*d++ = *s++) == 0) {
29#if (STRN_ZERO_PAD == 1)
30 /* Pad with zeros. */
31 for (; i<n; i++)
32 *d++ = 0;
33#endif /* STRN_ZERO_PAD */
34 return dst;
35 }
36 }
37 /* If we get here, then we have a full string, with n - 1 characters,
38 * so now we NUL terminate it and go home.
39 */
40 *d = 0;
41 }
42 return (dst);
43} /* Strncpy */
GLdouble s
Definition: gl.h:2039
GLdouble n
Definition: glext.h:7729
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define d
Definition: ke_i.h:81

Referenced by AbbrevStr(), AbsoluteToRelative(), BookmarkToURL(), Chdirs(), DefaultBookmarkName(), ExpandTilde(), FileToURL(), FTPChdir3(), FTPChdirAndGetCWD(), FTPGetCWD(), FTPGetLocalCWD(), GetHomeDir(), GetHostByName(), GetOurHostName(), GetUsrName(), GmTimeStr(), main(), MakePrompt(), MyInetAddr(), nFTPChdirAndGetCWD(), Path(), RunBookmarkEditor(), SetXtermTitle(), SpoolName(), UnDosLine(), and UnLslRLine().