aboutsummaryrefslogtreecommitdiffstats
path: root/man3/strcat.3
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2020-09-05 17:18:10 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2020-09-05 17:20:12 +0200
commit88893a773cbd219f08cc3ae34fffe079d89a120d (patch)
tree990eaeb2aef511d3e0c211b7eb4757ef25334edc /man3/strcat.3
parent3b27ce1573535e0585b83b83a8b3828af70afe67 (diff)
downloadman-pages-88893a773cbd219f08cc3ae34fffe079d89a120d.tar.gz
sprof.1, eventfd.2, execve.2, futex.2, getdents.2, mprotect.2, open_by_handle_at.2, recvmmsg.2, sched_setaffinity.2, CPU_SET.3, backtrace.3, bsearch.3, dl_iterate_phdr.3, dlinfo.3, duplocale.3, encrypt.3, envz_add.3, fopencookie.3, getaddrinfo.3, getaddrinfo_a.3, getdate.3, getgrent_r.3, getgrouplist.3, getifaddrs.3, getprotoent_r.3, getservent_r.3, hsearch.3, mallinfo.3, malloc_info.3, mbstowcs.3, mtrace.3, pthread_create.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, qsort.3, rand.3, strcat.3, strtok.3, tsearch.3, wordexp.3, core.5, aio.7, inotify.7, sock_diag.7, unix.7, user_namespaces.7: Use C99 style to declare loop counter variables
Rather than: sometype x; for (x = ....; ...) use for (sometype x = ...; ...) This brings the declaration and use closer together (thus aiding readability) and also clearly indicates the scope of the loop counter variable. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3/strcat.3')
-rw-r--r--man3/strcat.33
1 files changed, 1 insertions, 2 deletions
diff --git a/man3/strcat.3 b/man3/strcat.3
index dce33bae52..1d8fb73157 100644
--- a/man3/strcat.3
+++ b/man3/strcat.3
@@ -208,14 +208,13 @@ int
main(int argc, char *argv[])
{
#define LIM 4000000
- int j;
char p[LIM + 1]; /* +1 for terminating null byte */
time_t base;
base = time(NULL);
p[0] = \(aq\e0\(aq;
- for (j = 0; j < LIM; j++) {
+ for (int j = 0; j < LIM; j++) {
if ((j % 10000) == 0)
printf("%d %ld\en", j, (long) (time(NULL) \- base));
strcat(p, "a");