Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (gdb) bt
- #0 0x00007fe9905aa428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
- #1 0x00007fe9905ac187 in __GI_abort () at abort.c:118
- #2 0x00007fe9905ec7ea in __libc_message (do_abort=do_abort@entry=2,
- fmt=fmt@entry=0x7fe990705ed8 "*** Error in `%s': %s: 0x%s ***\n")
- at ../sysdeps/posix/libc_fatal.c:175
- #3 0x00007fe9905f537a in malloc_printerr (ar_ptr=<optimized out>, ptr=<optimized out>,
- str=0x7fe990706008 "double free or corruption (!prev)", action=3) at malloc.c:5006
- #4 _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3867
- #5 0x00007fe9905f953c in __GI___libc_free (mem=mem@entry=0x1c790e0) at malloc.c:2968
- #6 0x00007fe9905e2363 in _IO_new_fclose (fp=0x1c790e0) at iofclose.c:84
- #7 0x000000000042e242 in nacitajmakra (user=0x7fe98f7cc010) at lmy.c:8714
- #8 0x0000000000409364 in connect_user (user=0x7fe98f7cc010) at lmy.c:2368
- #9 0x00000000004079d3 in login (user=0x7fe98f7cc010, inpstr=0x7ffc973ebed0 "nikto") at lmy.c:2081
- #10 0x0000000000402929 in main (argc=1, argv=0x7ffc973ec7a8) at lmy.c:518
- (gdb)
- int nacitajmakra(user)
- UR_OBJECT user;
- {
- char filename[80],line[250];
- char *lajn;
- int i,lines=0,ch=0;
- FILE *fp;
- sprintf(filename,"%s/%s.mac",USERFILES,user->name);
- //spocita riadky:
- if (!(fp=fopen(filename,"r"))) { write_user(user,"~FTMakier: 0 | "); return 0; }
- while(!feof(fp))
- { ch = fgetc(fp);
- if(ch == '\n') { lines++; }
- }
- fclose(fp);
- lines--; //kvoli poslednemu blank riadku
- sprintf(text,"~FTMakier: %d | ",lines);
- write_user(user,text);
- if (lines>0)
- {
- if (!(fp=fopen(filename,"r"))) return 0;
- for(i=0;i<lines;i++)
- {
- fgets(line,250,fp);
- clear_words();
- word_count=wordfind(line);
- strcpy(user->makro[i],word[0]);
- lajn=remove_first(line);
- if (lajn[strlen(lajn)-1]=='\n') lajn[strlen(lajn)-1]='\0';
- strcpy(user->akcia[i],lajn);
- //ak najde makro auto, rovno ho vykona
- }
- fclose(fp);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement