FreeCalypso > hg > fc-selenite
annotate src/libsys/sprintf/sprintf.c @ 196:5f3544fc0308
AT@SPENH brought over from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 24 May 2020 19:46:18 +0000 |
parents | 425ab6d987f3 |
children |
rev | line source |
---|---|
86
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include <stdarg.h> |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 int |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 sprintf(char *strdest, char *fmt, ...) |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 { |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 va_list ap; |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 int len; |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 va_start(ap, fmt); |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 len = vsprintf(strdest, fmt, ap); |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 va_end(ap); |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 return(len); |
425ab6d987f3
src/libsys: pieced together from Citrine
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 } |