After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 106501 - Crash after removing last digit
Crash after removing last digit
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other All
: Normal major
: ---
Assigned To: Rich Burridge
Rich Burridge
Depends on:
Blocks:
 
 
Reported: 2003-02-19 07:34 UTC by Abel Cheung
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch just mentioned above (533 bytes, patch)
2003-02-19 07:35 UTC, Abel Cheung
none Details | Review

Description Abel Cheung 2003-02-19 07:34:17 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.
Comment 1 Abel Cheung 2003-02-19 07:35:59 UTC
Created attachment 14435 [details] [review]
Patch just mentioned above
Comment 2 Rich Burridge 2003-02-19 23:34:58 UTC
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!