Last change
on this file since 5c13d64 was 0580615, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Point of no return.
|
-
Property mode
set to
100644
|
File size:
570 bytes
|
Rev | Line | |
---|
[f40a309] | 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 |
|
---|
[0580615] | 15 | char *strfill(char *s, char c, unsigned n)
|
---|
[f40a309] | 16 | {
|
---|
| 17 | register unsigned i;
|
---|
| 18 | char *p;
|
---|
| 19 |
|
---|
| 20 | p = s;
|
---|
| 21 |
|
---|
| 22 | for (i = n; i--; )
|
---|
| 23 | *s++ = c;
|
---|
| 24 |
|
---|
| 25 | *s = '\0';
|
---|
| 26 | return(p);
|
---|
| 27 | }
|
---|
| 28 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.