mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
r16245: Cope with string being zero len. Klocwork bug #410. Jeremy.
(This used to be commit 46c12de07f
)
This commit is contained in:
parent
3c258755b5
commit
335c35318a
@ -202,8 +202,10 @@ char *getsmbpass(const char *prompt)
|
||||
fgets(buf, bufsize, in);
|
||||
}
|
||||
nread = strlen(buf);
|
||||
if (buf[nread - 1] == '\n')
|
||||
buf[nread - 1] = '\0';
|
||||
if (nread) {
|
||||
if (buf[nread - 1] == '\n')
|
||||
buf[nread - 1] = '\0';
|
||||
}
|
||||
|
||||
/* Restore echoing. */
|
||||
if (echo_off) {
|
||||
|
Loading…
Reference in New Issue
Block a user