Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
close the other half of the pipe in do_recv(). This fixes the problem
[rsync/rsync.git]
/
util.c
diff --git
a/util.c
b/util.c
index
d9c87ec
..
0442004
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-637,22
+637,15
@@
int vslprintf(char *str, int n, const char *format, va_list ap)
}
}
}
}
-
ret =
vsprintf(buf, format, ap);
-
- if (ret
< 0
) {
- str[0] = 0;
-
return -1
;
+ vsprintf(buf, format, ap);
+ ret = strlen(buf);
+ if (ret
> n
) {
+ /* yikes! */
+
exit(1)
;
}
}
-
- if (ret < n) {
- n = ret;
- } else if (ret > n) {
- ret = -1;
- }
-
- buf[n] = 0;
+ buf[ret] = 0;
- memcpy(str, buf,
n
+1);
+ memcpy(str, buf,
ret
+1);
return ret;
#endif
return ret;
#endif