data->ch = (7 & orig_char) + '0';
ADD_NEXT_OCTAL_RUNE_CHAR;
+ (void)add_failed;
+
data->cursor_type = orig_cursor_type;
if (prop && prop != ADD_FAILED )
Dynarr_free(prop);
gb.extent = Qnil;
gb.glyph = Vhscroll_glyph;
- add_glyph_rune(&data, &gb, BEGIN_GLYPHS,
- 0, GLYPH_CACHEL(w,
- HSCROLL_GLYPH_INDEX));
+ add_glyph_rune_noret(&data, &gb, BEGIN_GLYPHS,
+ 0, GLYPH_CACHEL(w,
+ HSCROLL_GLYPH_INDEX));
} else {
/* This duplicates code down below to add a newline to
the end of an otherwise empty line. */
int col =
column_at_point(b, pt,
1) + !!column_number_start_at_one;
- char buf[32];
+ char buf[sizeof(long)*3+1];
long_to_string(buf, col);
if (FRAME_TTY_P(f) && f->order_count > 1
&& f->order_count <= 99999999) {
/* Naughty, naughty */
- char *writable_str = alloca_array(char, 10);
- sprintf(writable_str, "-%d", f->order_count);
+ const size_t order_strmax = sizeof(f->order_count)*3+2;
+ char *writable_str = alloca_array(char, order_strmax);
+ int n = snprintf(writable_str, order_strmax, "-%d", f->order_count);
+ assert(n>=0 && n < order_strmax);
str = writable_str;
}
#endif /* HAVE_TTY */
/* This hard limit is ok since the string it will hold
has a fixed maximum length of 3. But just to be
safe... */
- char buf[10];
+ char buf[sizeof(long)*3+4];
+ int n;
Charcount chars = pos - BUF_BEGV(b);
Charcount total = BUF_ZV(b) - BUF_BEGV(b);
if (percent == 100)
percent = 99;
- sprintf(buf, "%d%%", percent);
+ n = snprintf(buf, sizeof(buf), "%d%%", percent);
+ assert(n>=0 && n < sizeof(buf));
Dynarr_add_many(mode_spec_bufbyte_string,
(Bufbyte *) buf, strlen(buf));
/* This hard limit is ok since the string it will hold
has a fixed maximum length of around 6. But just to
be safe... */
- char buf[10];
+ char buf[sizeof(long)*3+6];
+ int n;
Charcount chars = botpos - BUF_BEGV(b);
Charcount total = BUF_ZV(b) - BUF_BEGV(b);
percent = 99;
if (toppos <= BUF_BEGV(b))
- sprintf(buf, "Top%d%%", percent);
+ n = snprintf(buf, sizeof(buf), "Top%d%%", percent);
else
- sprintf(buf, "%d%%", percent);
-
+ n = snprintf(buf, sizeof(buf), "%d%%", percent);
+ assert(n>=0 && n < sizeof(buf));
Dynarr_add_many(mode_spec_bufbyte_string,
(Bufbyte *) buf, strlen(buf));