Pulse: adjust buffer to maximum
Just in case, adjust the buffer to format an int32 to a string as the maximum length that it could be. Change-Id: I00aede3f684211f9c860455063244422be1d0ee9 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6649 Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
b9a6a85bc3
commit
a962cc5543
@@ -309,9 +309,9 @@ ConfigView::UpdateDeskbarIconWidth()
|
|||||||
int width = atoi(fIconWidthControl->Text());
|
int width = atoi(fIconWidthControl->Text());
|
||||||
int min_width = GetMinimumViewWidth();
|
int min_width = GetMinimumViewWidth();
|
||||||
if (width < min_width || width > 50) {
|
if (width < min_width || width > 50) {
|
||||||
char temp[10];
|
char temp[12];
|
||||||
if (width < min_width) {
|
if (width < min_width) {
|
||||||
sprintf(temp, "%d", min_width);
|
snprintf(temp, 12, "%d", min_width);
|
||||||
width = min_width;
|
width = min_width;
|
||||||
} else {
|
} else {
|
||||||
strcpy(temp, "50");
|
strcpy(temp, "50");
|
||||||
@@ -368,7 +368,7 @@ ConfigView::_ResetDefaults()
|
|||||||
fTarget.SendMessage(message);
|
fTarget.SendMessage(message);
|
||||||
|
|
||||||
char temp[10];
|
char temp[10];
|
||||||
sprintf(temp, "%d", DEFAULT_DESKBAR_ICON_WIDTH);
|
snprintf(temp, 10, "%d", DEFAULT_DESKBAR_ICON_WIDTH);
|
||||||
fIconWidthControl->SetText(temp);
|
fIconWidthControl->SetText(temp);
|
||||||
// Need to force the model message to be sent
|
// Need to force the model message to be sent
|
||||||
fIconWidthControl->Invoke();
|
fIconWidthControl->Invoke();
|
||||||
|
|||||||
Reference in New Issue
Block a user