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:
d64488e
)
fixed handling of vsprintf on SunOS
author
Andrew Tridgell
<tridge@samba.org>
Sat, 16 May 1998 00:46:16 +0000
(
00:46
+0000)
committer
Andrew Tridgell
<tridge@samba.org>
Sat, 16 May 1998 00:46:16 +0000
(
00:46
+0000)
util.c
patch
|
blob
|
blame
|
history
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