diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-05-29 07:54:01 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-05-29 07:54:01 +0000 |
commit | 7814eca4b22f909e75c3321d9a157c2228198c5c (patch) | |
tree | 43532a31f72e64d3145d1f3a10d89f1a265d68b9 /source/lib | |
parent | 654c242045a70b600488a765eb46b6f79e484de9 (diff) | |
download | samba-7814eca4b22f909e75c3321d9a157c2228198c5c.tar.gz samba-7814eca4b22f909e75c3321d9a157c2228198c5c.tar.xz samba-7814eca4b22f909e75c3321d9a157c2228198c5c.zip |
handle errors from receive_smb better, and print error string
Diffstat (limited to 'source/lib')
-rw-r--r-- | source/lib/util.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index 233e9872711..e983a746731 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -2683,12 +2683,11 @@ BOOL receive_smb(int fd,char *buffer,int timeout) if (len == -1) return(False); - if (len > BUFFER_SIZE) - { - DEBUG(0,("Invalid packet length! (%d bytes)\n",len)); - if (len > BUFFER_SIZE + (SAFETY_MARGIN/2)) - exit(1); - } + if (len > BUFFER_SIZE) { + DEBUG(0,("Invalid packet length! (%d bytes)\n",len)); + if (len > BUFFER_SIZE + (SAFETY_MARGIN/2)) + exit(1); + } ok = (read_data(fd,buffer+4,len) == len); |