klog -pipe does not allow spaces

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Jun 22 14:50:42 CEST 2000


On 06/22/00 15:29:36 +0200 Tino Schwarze 
<tino.schwarze at informatik.tu-chemnitz.de> wrote:
+-----

| Hi Brandon,
|
| On Thu, Jun 22, 2000 at 08:23:32AM +0000, Brandon S. Allbery KF8NH wrote:
| > +-----
| > | Hi there,
| > | a friend of mine recently figured out that klog -pipe does not accept
| > | spaces within passwords. He hunted the problem down to the use of
| > | scanf() in line 654 of klog.c.
| > +--->8
| >
| > **ick**
| >
| > I'd like to shoot anyone who uses scanf() or fscanf().  It's almost
| always  > the wrong thing to do.
| >
| > | 1. use getchar and figure out end-of-line ourself
| > +--->8
| >
| > klog doesn't need to use raw mode, so EOL should be presented as \n.
| It is not about raw mode but its about \n vs. \r\n (e.g. on OS/2, Win*)
+--->8

Unless someone opened the fd in binary mode or uses a DOS/Win equivalent to 
raw mode, the C runtime will map the local newline convention to \n.

-- 
brandon s. allbery     [os/2][linux][solaris][japh]    allbery at kf8nh.apk.net
system administrator        [WAY too many hats]          allbery at ece.cmu.edu
electrical & computer engineering                                      KF8NH
carnegie mellon university      ["better check the oblivious first" -ke6sls]





More information about the Arla-drinkers mailing list