In num_tok, allow the user to specify '0' as plain '0' instead of

forcing them to use '00', and/or '0x0'.

Submitted by:	Johann Tonsing <jtonsing@mikom.csir.co.za>
This commit is contained in:
Nate Williams 1996-07-11 15:04:43 +00:00
parent 0375cce8bc
commit fd87c5bd16

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: file.c,v 1.6 1996/06/18 23:50:51 nate Exp $
* $Id: file.c,v 1.7 1996/06/19 01:08:58 nate Exp $
*/
#include <stdio.h>
#include <stdlib.h>
@ -457,7 +457,8 @@ num_tok(void)
if (c == '0') {
base = 8;
c = *s++;
if (c == 'x' || c == 'X') {
if (c == '\0') return 0;
else if (c == 'x' || c == 'X') {
c = *s++;
base = 16;
}