changeset 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 40be84c1aadd
children 3f0beddfd9c9
files SDL_sound.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/SDL_sound.c	Tue Oct 02 17:47:07 2001 +0000
+++ b/SDL_sound.c	Tue Oct 02 17:53:23 2001 +0000
@@ -236,6 +236,15 @@
 {
     int ux, uy;
 
+    if (x == y)  /* same pointer? Both NULL? */
+        return(0);
+
+    if (x == NULL)
+        return(-1);
+
+    if (y == NULL)
+        return(1);
+       
     do
     {
         ux = toupper((int) *x);