pos += ret;
}
- return strcpy(xkb_context_get_buffer(ctx, pos + 1), buf);
+ return strncpy(xkb_context_get_buffer(ctx, pos + 1), buf, pos + 1);
}
const char *
LedStateMaskText(struct xkb_context *ctx, enum xkb_state_component mask)
{
- char buf[1024];
+ char buf[1024] = {0};
size_t pos = 0;
if (mask == 0)
pos += ret;
}
- return strcpy(xkb_context_get_buffer(ctx, pos + 1), buf);
+ return strncpy(xkb_context_get_buffer(ctx, pos + 1), buf, pos + 1);
}
const char *
ControlMaskText(struct xkb_context *ctx, enum xkb_action_controls mask)
{
- char buf[1024];
+ char buf[1024] = {0};
size_t pos = 0;
if (mask == 0)
pos += ret;
}
- return strcpy(xkb_context_get_buffer(ctx, pos + 1), buf);
+ return strncpy(xkb_context_get_buffer(ctx, pos + 1), buf, pos + 1);
}