GNOME Bugzilla – Bug 106501
Crash after removing last digit
Last modified: 2004-12-22 21:47:04 UTC
When only 1 digit is shown on the screen, it will result in crash after I try to remove it. Hopefully the attached patch prevents this situation. However, I'm not sure what to do when trying to do so. Some calculators will set the digit to '0' when trying to remove last digit.
Created attachment 14435 [details] [review] Patch just mentioned above
Fixed in v4.2.53. A couple of comments here: 1/ I'm running on Solaris and even though I can see that the code is doing the wrong thing (i.e. writing '\0' to a character in front of the v->display string, it doesn't cause gcalctool to crash). 2/ I think you mean: if (strlen(v->display) > 0) { not: if (strlen(v->display) > 1) { The latter doesn't clear the first character. That's the patch I've applied. Thanks!