Last change
on this file since 06f6615 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
639 bytes
|
Line | |
---|
1 | /*
|
---|
2 | =============================================================================
|
---|
3 | strfill() -- fill a string with a constant byte and zero terminate it
|
---|
4 | Version 1 -- 1988-08-19 -- D.N. Lynx Crowe
|
---|
5 |
|
---|
6 | Where:
|
---|
7 | s = string pointer
|
---|
8 | c = constant byte
|
---|
9 | n = string length (not including the trailing zero)
|
---|
10 |
|
---|
11 | Returns a pointer to the string.
|
---|
12 | =============================================================================
|
---|
13 | */
|
---|
14 |
|
---|
15 | char *
|
---|
16 | strfill(s, c, n)
|
---|
17 | register char *s;
|
---|
18 | register char c;
|
---|
19 | register unsigned n;
|
---|
20 | {
|
---|
21 | register unsigned i;
|
---|
22 | char *p;
|
---|
23 |
|
---|
24 | p = s;
|
---|
25 |
|
---|
26 | for (i = n; i--; )
|
---|
27 | *s++ = c;
|
---|
28 |
|
---|
29 | *s = '\0';
|
---|
30 | return(p);
|
---|
31 | }
|
---|
32 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.