FreeCalypso > hg > fc-selenite
annotate src/libsys/sprintf/sprintf.c @ 209:d0547d47260a
uartfax.c: sync with Magnetite (Tango RI output)
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 20 Oct 2020 01:58:41 +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 } |