Fix more string is too small warnings

This commit is contained in:
twinaphex 2018-11-25 18:49:04 +01:00
parent b14ff4d504
commit ff4fa3be7a
3 changed files with 8 additions and 6 deletions

View File

@ -851,7 +851,7 @@ void netplay_get_architecture(char *frontend_architecture, size_t size)
static void netplay_announce(void)
{
char buf [2048];
char buf [4600];
char frontend_architecture[PATH_MAX_LENGTH];
char url [2048] = "http://lobby.libretro.com/add/";
char *username = NULL;

View File

@ -1990,7 +1990,7 @@ void netplay_handle_slaves(netplay_t *netplay)
void netplay_announce_nat_traversal(netplay_t *netplay)
{
#ifndef HAVE_SOCKET_LEGACY
char msg[512], host[PATH_MAX_LENGTH], port[6];
char msg[4200], host[PATH_MAX_LENGTH], port[6];
if (netplay->nat_traversal_state.have_inet4)
{

View File

@ -28,6 +28,8 @@
#include "../verbosity.h"
#include "../msg_hash.h"
#define CALLBACK_ERROR_SIZE 4200
static int file_decompressed_target_file(const char *name,
const char *valid_exts,
const uint8_t *cdata,
@ -80,9 +82,9 @@ next_file:
return 1;
error:
userdata->dec->callback_error = (char*)malloc(PATH_MAX_LENGTH);
userdata->dec->callback_error = (char*)malloc(CALLBACK_ERROR_SIZE);
snprintf(userdata->dec->callback_error,
PATH_MAX_LENGTH, "Failed to deflate %s.\n", path);
CALLBACK_ERROR_SIZE, "Failed to deflate %s.\n", path);
return 0;
}
@ -122,8 +124,8 @@ next_file:
return 1;
error:
dec->callback_error = (char*)malloc(PATH_MAX_LENGTH);
snprintf(dec->callback_error, PATH_MAX_LENGTH,
dec->callback_error = (char*)malloc(CALLBACK_ERROR_SIZE);
snprintf(dec->callback_error, CALLBACK_ERROR_SIZE,
"Failed to deflate %s.\n", path);
return 0;