aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-07-22 15:58:08 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-12-14 00:08:33 +0100
commiteb4abe4c55b2ff55c0a252f6f87f28d16be144d0 (patch)
tree8d535309977dca28ebdd52e4ed90ed3893f28ad2
parent5c4a001acdd67fc2c87af2b0233a8c03dd303a55 (diff)
downloadnx-libs-eb4abe4c55b2ff55c0a252f6f87f28d16be144d0.tar.gz
nx-libs-eb4abe4c55b2ff55c0a252f6f87f28d16be144d0.tar.bz2
nx-libs-eb4abe4c55b2ff55c0a252f6f87f28d16be144d0.zip
Keyboard.c: Use calloc instead of malloc + memset
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 22cf1b44d..1d3c94189 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -1337,11 +1337,7 @@ int nxagentResetKeyboard(void)
savedBellPercent, savedBellPitch, savedBellDuration);
#endif
- if (devBackup = malloc(sizeof(DeviceIntRec)))
- {
- memset(devBackup, 0, sizeof(DeviceIntRec));
- }
- else
+ if (!(devBackup = calloc(1, sizeof(DeviceIntRec))))
{
#ifdef PANIC
fprintf(stderr, "nxagentResetKeyboard: PANIC! Can't allocate backup structure.\n");