From 966c67cb2396387cd64f0d3bb40cbedb316beec7 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Tue, 19 Jul 2022 16:04:05 +0000 Subject: [PATCH] Fix issue with segfaulting because of misplaced variable set Co-authored-by: sigonasr2 --- current | Bin 21408 -> 21448 bytes src/main.c | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/current b/current index bad396c8d482d7ef956e4d18e8fe46bbb76fad65..0bf25ff7b074f1c0da1bb7ff99df23c9d55a9063 100755 GIT binary patch delta 2492 zcmZ`*eQZ-z6u-A!*FIQTU$^;IhU*F;+dyf%2xWn8ecQ_3a9cZJg9Mck1&d+=VT3MD z9S(?19dw-iG2=`oDqk@=QYCDPZYT_5ltH2(3AzzXx}d@Y6$$t}_k9o~@iy=L?){yQ z`*rTU?b}aJ?Wc)cdmm4f5>SCyYP;s_<5pVK=E|-g+}sY$WC!pxW5BK81hT%BFsBM*Ll^4P8x`?aR0z6CP4 z;N~G{GZy98Feb$>U5UL-kv14G7SgRSZWL&tBKH8F=B5uRb)Oj$E?Ns;%eeR&osry(f+%*eyTGC}n zn)lddT9%d*^1D3yahPK}loMei|9wJ~WjS#pGygU!tmVM*FFl5}x-y)Bvx*Q+6MUfU zf1o`dqI`bikxW9QPHVXW{$Y$S=h)HmW|&9pG*5-++K`wYF4@RbGBE5Oe_8M zC#=YNfg1_-vgX8I_&O`GytgwYg+q*%srDIV;XVk4=K@5u6wq0H?| zvHy`^H*>o>9hF1z#%}4Eb5cBQl$q6`Sx2y&#)I99f_-g2!fGcEV*zy~>u2!Pka;t?=3x^xSZ+Wh|6TeFWH=8^4dKv_ zvOZH!!>}`l=E8aBcGpL^4Jtcuopn2g-Ht5^UT8b^1>5@6W@syD@vKueUtCe!>0k8- zA!1Wa?0d1XCiaK8T#VgmlsX@+MS59n@m;Co7fb3)GT(J>+8$5Ns~$3Y!?PTjjUUZ3 zF4}-0GuRl$WVsJv2=Nr+DB>7m`?xH>j=27^EZ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7$jB`WX=cw`vl3A*K)UFWMtNbUS za|y?ksa^s4m&~vZV=gI%wp%WhTP1O6oh(C;UCdcq)qXYV7baf>WPc!Wte>dfn>HoD z0X5DEXfEaq=g_OnXe82K9HNm`B{y`DB}>;*JZW8}E>Od-RF&m00aXh?XIYL#JKY+N68Np`Er|N;u-j*52Jxkn${=+5a-hv;j_Z(h zd<|G12gY)i)fPj;5pb5f80|JzLsfY(9^fvtX-6jmhRe4=o8Jw){bsm~^^o7qXvZ!H m!~PsrJ5B-oFQw81&SfIb-&v8v^c5>M3N;luv>!SvX8a4TLsqH) diff --git a/src/main.c b/src/main.c index eeea789..e0b9f39 100644 --- a/src/main.c +++ b/src/main.c @@ -24,9 +24,9 @@ int main(int argc,char**argv) { } } fseek(file,0,0); - const char*names[nameCount]; + char*names[nameCount]; + int currentCount=0; while (!feof(file)) { - int currentCount=0; if (fgetc(file)=='"') { //Start reading the name. char*newName=malloc(1); @@ -37,11 +37,12 @@ int main(int argc,char**argv) { newName[length-2]=c; newName[length-1]='\0'; } + //printf("%s\n",newName); names[currentCount++]=newName; } } for (int i=0;i