🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: gnu.g++.lib.bug
1 messages
1 total messages Started by Doug Moore Tue, 14 Apr 1992 03:16
sign bug in stream.C: itoa
#76
Author: Doug Moore
Date: Tue, 14 Apr 1992 03:16
33 lines
1123 bytes
(previous posted inadvertantly to bug-g++)

The use of the itoa function in stream.C, as via dec(), places the minus
sign for negative numbers after the number, rather than before it.
The following patch fixes the problem.

Doug Moore (dougm@cs.rice.edu)


*** stream.C~	Mon Apr 13 21:08:54 1992
--- stream.C	Mon Apr 13 21:18:20 1992
***************
*** 44,51 ****
      if (needed < (2+neg) || ptr > EndBuffer)
  	return NULL;
      *--ptr = 0;
-     if (neg)
- 	*--ptr = '-';
      
      if (i == 0)
  	*--ptr = '0';
--- 44,49 ----
***************
*** 58,63 ****
--- 56,63 ----
  	    ch += '0';
  	*--ptr = ch;
      }
+     if (neg)
+ 	*--ptr = '-';
      if (size == 0)
  	return ptr;
      while (ptr > buf)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads