diff --git a/spot.c b/spot.c index 4616a90..5aa79ed 100644 --- a/spot.c +++ b/spot.c @@ -29,7 +29,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. void spot_update_bar(int spot, int mon) { int i, n = 0, len = 0; client *o, *c = NULL; - char *title = alloca(SPOT_BUFF); *title = 0; + char title[SPOT_BUFF]; *title = 0; monitor *m = &monitors[mon]; for_windows(i, o) if (o->manage && o->spot == spot && o->monitor == mon) diff --git a/textbox.c b/textbox.c index 050c2d7..a739d1e 100644 --- a/textbox.c +++ b/textbox.c @@ -95,7 +95,7 @@ void textbox_font(textbox *tb, char *font, char *fg, char *bg) void textbox_extents(textbox *tb) { int length = strlen(tb->text) + strlen(tb->prompt); - char *line = alloca(length + 1); + char line[length + 1]; sprintf(line, "%s%s", tb->prompt, tb->text); XftTextExtents8(display, tb->font, (unsigned char*)line, length, &tb->extents); } @@ -190,7 +190,7 @@ void textbox_draw(textbox *tb) length = text_len + prompt_len; cursor_offset = MIN(tb->cursor + prompt_len, length); - line = alloca(length + 10); + char eline[length + 10]; line = eline; sprintf(line, "%s%s", prompt, text); // replace spaces so XftTextExtents8 includes their width