Fix issue with segfaulting because of misplaced variable set
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
c6970bc35d
commit
966c67cb23
@ -24,9 +24,9 @@ int main(int argc,char**argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fseek(file,0,0);
|
fseek(file,0,0);
|
||||||
const char*names[nameCount];
|
char*names[nameCount];
|
||||||
while (!feof(file)) {
|
|
||||||
int currentCount=0;
|
int currentCount=0;
|
||||||
|
while (!feof(file)) {
|
||||||
if (fgetc(file)=='"') {
|
if (fgetc(file)=='"') {
|
||||||
//Start reading the name.
|
//Start reading the name.
|
||||||
char*newName=malloc(1);
|
char*newName=malloc(1);
|
||||||
@ -37,11 +37,12 @@ int main(int argc,char**argv) {
|
|||||||
newName[length-2]=c;
|
newName[length-2]=c;
|
||||||
newName[length-1]='\0';
|
newName[length-1]='\0';
|
||||||
}
|
}
|
||||||
|
//printf("%s\n",newName);
|
||||||
names[currentCount++]=newName;
|
names[currentCount++]=newName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i=0;i<nameCount;i++) {
|
for (int i=0;i<nameCount;i++) {
|
||||||
printf("%s\n",(char*)((*names)[i]));
|
printf("%s\n",names[i]);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user