annotate target-utils/libc/strcat.c @ 1011:6d9b10633f10 default tip

etmsync Pirelli IMEI retrieval: fix poor use of printf() Bug reported by Vadim Yanitskiy <fixeria@osmocom.org>: the construct where a static-allocated string was passed to printf() without any format arguments causes newer compilers to report a security problem. Given that formatted output is not needed here, just fixed string output, change printf() to fputs(), and direct the error message to stderr while at it.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 23 May 2024 17:29:57 +0000
parents 7fb62fc724dc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
87
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * Concatenate s2 on the end of s1. S1's space must be large enough.
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * Return s1.
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 */
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 char *
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 strcat(s1, s2)
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 register char *s1, *s2;
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 {
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 register char *os1;
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 os1 = s1;
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 while (*s1++)
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 ;
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 --s1;
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 while (*s1++ = *s2++)
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 ;
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 return(os1);
7fb62fc724dc target-utils/libc: beginning of newlib-ectomy
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 }