comparison SDL_sound.c @ 98:dfdf7b4e05bd

Changed __Sound_strcasecmp() to handle NULL strings gracefully.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 02 Oct 2001 17:53:23 +0000
parents 25ee62c6b333
children 72502bed0aef
comparison
equal deleted inserted replaced
97:40be84c1aadd 98:dfdf7b4e05bd
234 */ 234 */
235 int __Sound_strcasecmp(const char *x, const char *y) 235 int __Sound_strcasecmp(const char *x, const char *y)
236 { 236 {
237 int ux, uy; 237 int ux, uy;
238 238
239 if (x == y) /* same pointer? Both NULL? */
240 return(0);
241
242 if (x == NULL)
243 return(-1);
244
245 if (y == NULL)
246 return(1);
247
239 do 248 do
240 { 249 {
241 ux = toupper((int) *x); 250 ux = toupper((int) *x);
242 uy = toupper((int) *y); 251 uy = toupper((int) *y);
243 if (ux > uy) 252 if (ux > uy)