}
size_t len = SDL_strlen(logMessage);
- strcpy(message, logMessage);
-
- // Chop off final endline.
-
- if ((len > 0) && (message[len-1] == '\n')) {
- message[--len] = '\0';
- if ((len > 0) && (message[len-1] == '\r')) { // catch "\r\n", too.
- message[--len] = '\0';
- }
- }
+ SDL_strlcpy(message, logMessage,len+1);
SDL_RWops *rwops = SDL_RWFromFile("log.txt", "a+");
char *text;
}
size_t len = SDL_strlen(logMessage);
- strcpy(message, logMessage);
-
- // Chop off final endline.
-
- if ((len > 0) && (message[len-1] == '\n')) {
- message[--len] = '\0';
- if ((len > 0) && (message[len-1] == '\r')) { // catch "\r\n", too.
- message[--len] = '\0';
- }
- }
+ SDL_strlcpy(message, logMessage,len+1);
SDL_RWops *rwops = SDL_RWFromFile("log.txt", "a+");
char *text;