summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-05-29 07:54:01 +0000
committerAndrew Tridgell <tridge@samba.org>1996-05-29 07:54:01 +0000
commitec520018094a441017a539136e8f561900dd1318 (patch)
treee531dd1daa64610ca6089060e89227dec3551741 /source3/lib/util.c
parentdebd5b6ae9e4b308398d1d0a305ed4357ff6e1a5 (diff)
downloadsamba-ec520018094a441017a539136e8f561900dd1318.tar.gz
samba-ec520018094a441017a539136e8f561900dd1318.tar.bz2
samba-ec520018094a441017a539136e8f561900dd1318.zip
handle errors from receive_smb better, and print error string
(This used to be commit 7814eca4b22f909e75c3321d9a157c2228198c5c)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 233e987271..e983a74673 100644
--- a/source3/lib/util.c
+++ b/source3/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);