delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/09/01/13:04:29

To: ronis AT onsager DOT chem DOT mcgill DOT ca (David Ronis)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: bug in scanf()
Date: Thu, 01 Sep 94 18:01:18 +0200
From: Fulvio Corno <corno AT athena DOT polito DOT it>

I believe this is not a bug, but a consequence of buffered input:
when an illegal input is entered, it is not *consumed* by scanf(), so
at the next iteration the buffer contents are unchanged, hence the
infinite loop.

The same behavior shows up on my Sun.

	Fulvio

*=====================================================================*
| Fulvio Corno                                                        |
| Dip. Automatica e Informatica      Tel: +39 11 564 7067             |
| Politecnico di Torino              Fax: +39 11 564 7099             |
| C.so Duca degli Abruzzi 24         E-mail: Fulvio DOT Corno AT polito DOT it   |
| I-10129 TORINO (Italy)             Internet: corno AT athena DOT polito DOT it |
*=====================================================================*

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019