Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
65575e9
)
fixed bug where strtok() could return NULL in getpassf().
author
Andrew Tridgell
<tridge@samba.org>
Fri, 8 Jan 1999 10:42:29 +0000
(10:42 +0000)
committer
Andrew Tridgell
<tridge@samba.org>
Fri, 8 Jan 1999 10:42:29 +0000
(10:42 +0000)
authenticate.c
patch
|
blob
|
blame
|
history
diff --git
a/authenticate.c
b/authenticate.c
index
896366a
..
885e40b
100644
(file)
--- a/
authenticate.c
+++ b/
authenticate.c
@@
-170,8
+170,10
@@
static char *getpassf(char *filename)
buffer[sizeof(buffer)-1]='\0';
if ( (len=read(fd,buffer,sizeof(buffer)-1)) > 0)
{
buffer[sizeof(buffer)-1]='\0';
if ( (len=read(fd,buffer,sizeof(buffer)-1)) > 0)
{
+ char *p = strtok(buffer,"\n\r");
close(fd);
close(fd);
- return strdup(strtok(buffer,"\n\r"));
+ if (p) p = strdup(p);
+ return p;
}
return NULL;
}
return NULL;