Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. char test[65536];
  2.  
  3. void loader(FILE * srec)
  4. {
  5. char instring[SREC_LEN];
  6. char test[65536]; // This isn't used, but the program crashes without it for some reason
  7. int i=0;
  8. int j=0, k,l;
  9. while (fgets(instring, SREC_LEN, srec) != NULL)
  10. {
  11.  
  12. while(instring[i] != 'n') // Counts the characters in the s-record
  13. {
  14. i++;
  15.  
  16. }
  17. j = j+i;
  18. for(k=0;k<=i;k++) // Puts the records into memory
  19. {
  20. memory[l] = instring[k];
  21. l++;
  22. }
  23. l = j;
  24.  
  25. }
  26. #ifdef DEBUG
  27. printf("MEMORY: %s",memory);
  28. #endif // DEBUG
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement