Commit 1ef7b1f7 authored by Erwin Janssen's avatar Erwin Janssen

Fixed use of unitialized variable in lefty

In the file cmd/lefty/ws/x11/gquery.c, function Gqwpopaction:
THe char c is declared without initializer, giving it a unpredictable
value. If the next if statement takes the false branch, the function where
c is set is not executed. The next if statement then checks `c != 13`, but
because C could have any value, the behavior is unpredictable.
Initializing c with a known value, such as 0, fixes the problem.
parent 2d95aab6
......@@ -306,7 +306,7 @@ int GQqueryask (
void Gqwpopaction (Widget w, XEvent *evp, char **app, unsigned int *anp) {
Gwidget_t *widget;
char c;
char c = 0;
if (evp->type == KeyPress || evp->type == KeyRelease)
XLookupString ((XKeyEvent *) evp, &c, 1, NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment