No, there's no reason not to use fprintf
authorSam Lantinga <slouken@libsdl.org>
Fri, 05 Jul 2013 21:37:27 -0700
changeset 7350302af2a46a66
parent 7349 a96c85910792
child 7351 668a3dc28361
No, there's no reason not to use fprintf
src/SDL_log.c
     1.1 --- a/src/SDL_log.c	Fri Jul 05 21:25:32 2013 -0700
     1.2 +++ b/src/SDL_log.c	Fri Jul 05 21:37:27 2013 -0700
     1.3 @@ -398,16 +398,9 @@
     1.4      }
     1.5  #elif defined(__PSP__)
     1.6      {
     1.7 -        unsigned int length;
     1.8 -        char*        output;
     1.9          FILE*        pFile;
    1.10 -        /* !!! FIXME: is there any reason we didn't just use fprintf() here? */
    1.11 -        length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 2;
    1.12 -        output = SDL_stack_alloc(char, length);
    1.13 -        SDL_snprintf(output, length, "%s: %s\n", SDL_priority_prefixes[priority], message);
    1.14          pFile = fopen ("SDL_Log.txt", "a");
    1.15 -        fwrite (output, strlen (output), 1, pFile);
    1.16 -        SDL_stack_free(output);
    1.17 +        fprintf(pFile, "%s: %s\n", SDL_priority_prefixes[priority], message);
    1.18          fclose (pFile);
    1.19      }
    1.20  #endif