]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix some more use of uninitialized locals; fix matchacl
authorRudolf Polzer <divverent@xonotic.org>
Wed, 25 Apr 2012 14:52:51 +0000 (16:52 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 25 Apr 2012 14:52:51 +0000 (16:52 +0200)
qcsrc/common/command/generic.qc
qcsrc/common/util.qc
qcsrc/menu/item/nexposee.c
qcsrc/menu/xonotic/languagelist.c

index 73fe45c406ab789e195718107e801a4ac5f91a6f..eaa44b3813c38bc3f533691105074b0e4dd32b35 100644 (file)
@@ -263,6 +263,7 @@ void GenericCommand_maplist(float request, float argc)
                                        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
                                        argc = tokenizebyseparator(cvar_string("g_maplist"), " ");
                                        
+                                       tmp_string = "";
                                        for(i = 0; i < argc; ++i)
                                                if(MapInfo_CheckMap(argv(i)))
                                                        tmp_string = strcat(tmp_string, " ", argv(i));
@@ -279,6 +280,7 @@ void GenericCommand_maplist(float request, float argc)
                                        {
                                                argc = tokenizebyseparator(cvar_string("g_maplist"), " ");
                                                
+                                               tmp_string = "";
                                                for(i = 0; i < argc; ++i)
                                                        if(argv(i) != argv(2))
                                                                tmp_string = strcat(tmp_string, " ", argv(i));
index 582777647c9fcd2e2798baa4c695ecea269d3969..a1e0595891b5bf723ee8a7c41d1ce6c4e8ee1acc 100644 (file)
@@ -859,6 +859,8 @@ float cvar_settemp(string tmp_cvar, string tmp_value)
 {
        float created_saved_value;
        entity e;
+
+       created_saved_value = FALSE;
        
        if not(tmp_cvar || tmp_value)
        {
@@ -1825,6 +1827,7 @@ float matchacl(string acl, string str)
        while(acl)
        {
                t = car(acl); acl = cdr(acl);
+
                d = 1;
                if(substring(t, 0, 1) == "-")
                {
@@ -1833,10 +1836,11 @@ float matchacl(string acl, string str)
                }
                else if(substring(t, 0, 1) == "+")
                        t = substring(t, 1, strlen(t) - 1);
+
                if(substring(t, -1, 1) == "*")
                {
                        t = substring(t, 0, strlen(t) - 1);
-                       s = substring(s, 0, strlen(t));
+                       s = substring(str, 0, strlen(t));
                }
                else
                        s = str;
index 02f12242525835f1735029b0eda0365f03907faf..8f8f45119f8744bd74d900776d4b97015bc25406 100644 (file)
@@ -305,6 +305,7 @@ float Nexposee_keyDown(entity me, float scan, float ascii, float shift)
        }
        switch(me.animationState)
        {
+               default:
                case 0:
                case 3:
                        nexposeeKey = ((scan == K_SPACE) || (scan == K_ENTER) || (scan == K_KP_ENTER));
@@ -318,6 +319,7 @@ float Nexposee_keyDown(entity me, float scan, float ascii, float shift)
        {
                switch(me.animationState)
                {
+                       default:
                        case 0:
                        case 3:
                                me.animationState = 1;
index 5f6226f493fbee1ec5c5d1214cdf6aae16f62b1e..5be639a07559ec27058539e8c838b3526f8e8d43 100644 (file)
@@ -153,6 +153,7 @@ void XonoticLanguageList_getLanguages(entity me)
        buf = buf_create();
 
        fh = fopen("languages.txt", FILE_READ);
+       i = 0;
        while((s = fgets(fh)))
        {
                n = tokenize_console(s);