1 //+----------------------------------------------------------------------------
9 // Copyright (C) 2003 Scott Gasch
11 // Created: sgasch 5 Jul 2003
13 //+----------------------------------------------------------------------------
18 strncpy(CHAR *pDest, CHAR *pSrc, SIZE_T u)
23 while ((v < u) && (*pSrc))
30 // If we ran out of space, null terminate the dest buffer
32 if ((*pSrc) && (u > 0))
58 CHAR *p = (buf + uBufLen);
59 ULONG uSpaceLeft = uBufLen;
64 // null terminate the workspace buffer
88 // Based on base, do the conversion. Build the string backwards from
89 // less significant digits. Stop if we finish or if we run out of
97 *p = (uMagnitude % 10) + '0';
102 while((uSpaceLeft > 0) && (uMagnitude != 0));
107 *p = "0123456789ABCDEF"[uMagnitude & 15];
112 while((uSpaceLeft > 0) && (uMagnitude != 0));
117 *p = (uMagnitude & 7) + '0';
122 while((uSpaceLeft > 0) && (uMagnitude != 0));