mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-16 22:43:58 +03:00
gtk: toolbar: Handle snprintf error
This commit is contained in:
parent
a584c6bb3b
commit
836b5b6126
@ -673,15 +673,22 @@ nsgtk_toolbar_customisation_save(struct nsgtk_toolbar *tb)
|
||||
for (location = BACK_BUTTON;
|
||||
location < PLACEHOLDER_BUTTON;
|
||||
location++) {
|
||||
int written;
|
||||
itemid = itemid_from_location(tb, location);
|
||||
if (itemid == PLACEHOLDER_BUTTON) {
|
||||
/* no more filled locations */
|
||||
break;
|
||||
}
|
||||
start += snprintf(start,
|
||||
written = snprintf(start,
|
||||
orderlen - (start - order),
|
||||
"%s/",
|
||||
tb->items[itemid].name);
|
||||
if ((written < 0) ||
|
||||
(written >= orderlen - (start - order))) {
|
||||
free(order);
|
||||
return NSERROR_UNKNOWN;
|
||||
}
|
||||
start += written;
|
||||
|
||||
if ((start - order) >= orderlen) {
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user