Mercurial > sdl-ios-xcode
comparison src/cdrom/win32/SDL_syscdrom.c @ 1379:c0a74f199ecf
Use only safe string functions
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 19 Feb 2006 23:46:34 +0000 |
parents | 19418e4422cb |
children | d910939febfa |
comparison
equal
deleted
inserted
replaced
1378:dc0e13e7e1ae | 1379:c0a74f199ecf |
---|---|
61 int i; | 61 int i; |
62 | 62 |
63 if ( SDL_numcds < MAX_DRIVES ) { | 63 if ( SDL_numcds < MAX_DRIVES ) { |
64 /* Add this drive to our list */ | 64 /* Add this drive to our list */ |
65 i = SDL_numcds; | 65 i = SDL_numcds; |
66 SDL_cdlist[i] = (char *)SDL_malloc(SDL_strlen(drive)+1); | 66 SDL_cdlist[i] = SDL_strdup(drive); |
67 if ( SDL_cdlist[i] == NULL ) { | 67 if ( SDL_cdlist[i] == NULL ) { |
68 SDL_OutOfMemory(); | 68 SDL_OutOfMemory(); |
69 return; | 69 return; |
70 } | 70 } |
71 SDL_strcpy(SDL_cdlist[i], drive); | |
72 ++SDL_numcds; | 71 ++SDL_numcds; |
73 #ifdef CDROM_DEBUG | 72 #ifdef CDROM_DEBUG |
74 fprintf(stderr, "Added CD-ROM drive: %s\n", drive); | 73 fprintf(stderr, "Added CD-ROM drive: %s\n", drive); |
75 #endif | 74 #endif |
76 } | 75 } |