Explorar o código

Actually, this should be a memcpy().

We already know the exact length we just allocated, and we plan to append
 our own null terminator to the end of the copy, so this makes more sense.
Ryan C. Gordon %!s(int64=13) %!d(string=hai) anos
pai
achega
3984c7d8e3
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/filesystem/beos/SDL_sysfilesystem.cc

+ 1 - 1
src/filesystem/beos/SDL_sysfilesystem.cc

@@ -63,7 +63,7 @@ SDL_GetBasePath(void)
         return NULL;
         return NULL;
     }
     }
 
 
-    strcpy(retval, str);
+    SDL_memcpy(retval, str, len);
     retval[len] = '/';
     retval[len] = '/';
     retval[len+1] = '\0';
     retval[len+1] = '\0';
     return retval;
     return retval;