Prevent more implicit memsets

This commit is contained in:
twinaphex 2016-10-16 01:40:29 +02:00
parent 2b834ce9d8
commit a4a1e96210
3 changed files with 14 additions and 6 deletions

View File

@ -640,14 +640,16 @@ static void handle_hotplug(android_input_data_t *android_data,
struct android_app *android_app, int *port, int id, struct android_app *android_app, int *port, int id,
int source) int source)
{ {
char device_name[256] = {0}; char device_name[256];
char device_model[256] = {0}; char device_model[256];
char name_buf[256] = {0}; char name_buf[256];
int vendorId = 0; int vendorId = 0;
int productId = 0; int productId = 0;
bool back_mapped = false; bool back_mapped = false;
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
device_name[0] = device_model[0] = name_buf[0] = '\0';
frontend_android_get_name(device_model, sizeof(device_model)); frontend_android_get_name(device_model, sizeof(device_model));
RARCH_LOG("Device model: (%s).\n", device_model); RARCH_LOG("Device model: (%s).\n", device_model);

View File

@ -362,7 +362,9 @@ static void udev_check_device(struct udev_device *dev, const char *path, bool ho
default: default:
if (hotplugged) if (hotplugged)
{ {
char msg[PATH_MAX_LENGTH] = {0}; char msg[PATH_MAX_LENGTH];
msg[0] = '\0';
snprintf(msg, sizeof(msg), "Device #%u (%s) connected.", pad, path); snprintf(msg, sizeof(msg), "Device #%u (%s) connected.", pad, path);
runloop_msg_queue_push(msg, 0, 60, false); runloop_msg_queue_push(msg, 0, 60, false);

View File

@ -39,15 +39,19 @@ void x11_handle_key_event(XEvent *event, XIC ic, bool filter)
int i; int i;
unsigned state, key; unsigned state, key;
uint16_t mod = 0; uint16_t mod = 0;
uint32_t chars[32] = {0}; uint32_t chars[32];
bool down = event->type == KeyPress; bool down = event->type == KeyPress;
int num = 0; int num = 0;
KeySym keysym = 0; KeySym keysym = 0;
chars[0] = '\0';
if (down && !filter) if (down && !filter)
{ {
char keybuf[32] = {0}; char keybuf[32];
keybuf[0] = '\0';
#ifdef X_HAVE_UTF8_STRING #ifdef X_HAVE_UTF8_STRING
Status status = 0; Status status = 0;