]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.c
Fix CTF flags getting stuck on slopes instead of sliding down
[xonotic/darkplaces.git] / common.c
index 47edc4c9c06211253896925212c7358a01772670..667f99c6bbe887ca940a568f632663c81dcbf198 100644 (file)
--- a/common.c
+++ b/common.c
@@ -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;
 }