Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. (gdb) bt
  2. #0 0x00007fe9905aa428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
  3. #1 0x00007fe9905ac187 in __GI_abort () at abort.c:118
  4. #2 0x00007fe9905ec7ea in __libc_message (do_abort=do_abort@entry=2,
  5. fmt=fmt@entry=0x7fe990705ed8 "*** Error in `%s': %s: 0x%s ***\n")
  6. at ../sysdeps/posix/libc_fatal.c:175
  7. #3 0x00007fe9905f537a in malloc_printerr (ar_ptr=<optimized out>, ptr=<optimized out>,
  8. str=0x7fe990706008 "double free or corruption (!prev)", action=3) at malloc.c:5006
  9. #4 _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3867
  10. #5 0x00007fe9905f953c in __GI___libc_free (mem=mem@entry=0x1c790e0) at malloc.c:2968
  11. #6 0x00007fe9905e2363 in _IO_new_fclose (fp=0x1c790e0) at iofclose.c:84
  12. #7 0x000000000042e242 in nacitajmakra (user=0x7fe98f7cc010) at lmy.c:8714
  13. #8 0x0000000000409364 in connect_user (user=0x7fe98f7cc010) at lmy.c:2368
  14. #9 0x00000000004079d3 in login (user=0x7fe98f7cc010, inpstr=0x7ffc973ebed0 "nikto") at lmy.c:2081
  15. #10 0x0000000000402929 in main (argc=1, argv=0x7ffc973ec7a8) at lmy.c:518
  16. (gdb)
  17.  
  18.  
  19. int nacitajmakra(user)
  20. UR_OBJECT user;
  21. {
  22. char filename[80],line[250];
  23. char *lajn;
  24. int i,lines=0,ch=0;
  25. FILE *fp;
  26.  
  27. sprintf(filename,"%s/%s.mac",USERFILES,user->name);
  28.  
  29. //spocita riadky:
  30. if (!(fp=fopen(filename,"r"))) { write_user(user,"~FTMakier: 0 | "); return 0; }
  31. while(!feof(fp))
  32. { ch = fgetc(fp);
  33. if(ch == '\n') { lines++; }
  34. }
  35. fclose(fp);
  36. lines--; //kvoli poslednemu blank riadku
  37. sprintf(text,"~FTMakier: %d | ",lines);
  38. write_user(user,text);
  39. if (lines>0)
  40. {
  41. if (!(fp=fopen(filename,"r"))) return 0;
  42. for(i=0;i<lines;i++)
  43. {
  44. fgets(line,250,fp);
  45. clear_words();
  46. word_count=wordfind(line);
  47. strcpy(user->makro[i],word[0]);
  48. lajn=remove_first(line);
  49. if (lajn[strlen(lajn)-1]=='\n') lajn[strlen(lajn)-1]='\0';
  50. strcpy(user->akcia[i],lajn);
  51. //ak najde makro auto, rovno ho vykona
  52. }
  53. fclose(fp);
  54. }
  55. return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement