fork download
  1. char *depends_parser(FILE *pkgfile_dir)
  2. {
  3. char character, last_character = '0', *string_depends = NULL, **depends_alone = NULL, *depends_p;
  4. int character_count = 0, memory_count = 1, position_check = 0;
  5.  
  6. while ((character = getc(pkgfile_dir)) != EOF)
  7. {
  8. if (character == '\n')
  9. {
  10. if ((strstr(string_depends, "Depends on:")))
  11. {
  12. string_depends[character_count] = '\0';
  13. depends_p = string_depends;
  14.  
  15. while (*depends_p != '\0')
  16. {
  17.  
  18. if (*depends_p == ':')
  19. {
  20. position_check = 1;
  21. depends_p++;
  22.  
  23. if (!isalpha(*depends_p)){}
  24. else
  25. {
  26. depends_p--;
  27. }
  28. }
  29. else if (position_check == 1)
  30. {
  31. printf("%c", *depends_p);
  32. }
  33.  
  34. depends_p++;
  35. }
  36. break;
  37. }
  38. else
  39. {
  40. character_count = 0;
  41. memory_count = 1;
  42. string_depends = malloc(0);
  43. }
  44. }
  45. else
  46. {
  47.  
  48. string_depends = (char *) realloc(string_depends, memory_count);
  49. string_depends[character_count] = character;
  50.  
  51. character_count++;
  52. memory_count++;
  53. }
  54. }
  55.  
  56. if (string_depends)
  57. free(string_depends);
  58. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1: error: expected ‘)’ before ‘*’ token
stdout
Standard output is empty