source: buchla-68k/libsm/strfill.c@ c65a0e2

Last change on this file since c65a0e2 was 109c83b, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Compiled full ROM in Hatari.

  • Property mode set to 100644
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
15char *
16strfill(s, c, n)
17register char *s;
18register char c;
19register 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.