Skip to content

Commit 5728110

Browse files
manishmalikzimmerle
authored andcommitted
Declaring variable outside the for loop
1 parent c855291 commit 5728110

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/multithread_c/multi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ int main (int argc, char **argv)
8585
int i = 0;
8686
pid_t pid;
8787
int shmid;
88-
88+
int h;
89+
8990
modsec = msc_init();
9091

9192
key = ftok("shmdemo.c", 'R');
@@ -110,7 +111,7 @@ int main (int argc, char **argv)
110111

111112
msc_rules_dump(rules);
112113

113-
for (int h = 0; h < FORKS; h++) {
114+
for (h = 0; h < FORKS; h++) {
114115
pid = fork();
115116
if (pid == 0) {
116117
pthread_create (&thread[h*TRHREADS], NULL, (void *) &process_request, (void *) NULL);

0 commit comments

Comments
 (0)