]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.c
Now that SSE is off, we can also kill -mstackrealign. GCC bug worked around!
[xonotic/darkplaces.git] / common.c
index f75d24eafa5d952589000cef62fb945c44a28e36..667f99c6bbe887ca940a568f632663c81dcbf198 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1588,7 +1588,7 @@ static void COM_SetGameType(int index)
                // if there are spaces in the game's network filter name it would
                // cause parse errors in getservers in dpmaster, so we need to replace
                // them with _ characters
-               strlcpy(gamenetworkfilternamebuffer, gamenetworkfiltername, sizeof(gamenetworkfiltername));
+               strlcpy(gamenetworkfilternamebuffer, gamenetworkfiltername, sizeof(gamenetworkfilternamebuffer));
                while ((s = strchr(gamenetworkfilternamebuffer, ' ')) != NULL)
                        *s = '_';
                gamenetworkfiltername = gamenetworkfilternamebuffer;
@@ -1620,7 +1620,7 @@ void COM_Init_Commands (void)
                {
                        // arg contains whitespace, store quotes around it
                        com_cmdline[n++] = '\"';
-                       while ((n < ((int)sizeof(com_cmdline) - 1)) && com_argv[j][i])
+                       while ((n < ((int)sizeof(com_cmdline) - 2)) && com_argv[j][i])
                                com_cmdline[n++] = com_argv[j][i++];
                        com_cmdline[n++] = '\"';
                }
@@ -2287,7 +2287,7 @@ size_t base64_encode(unsigned char *buf, size_t buflen, size_t outbuflen)
        for(i = blocks; i > 0; )
        {
                --i;
-               base64_3to4(buf + 3*i, buf + 4*i, buflen - 3*i);
+               base64_3to4(buf + 3*i, buf + 4*i, (int)(buflen - 3*i));
        }
        return blocks * 4;
 }