projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More comment cleanup.
[u/mdw/putty]
/
psftp.c
diff --git
a/psftp.c
b/psftp.c
index
e585732
..
8ed4e20
100644
(file)
--- a/
psftp.c
+++ b/
psftp.c
@@
-1448,40
+1448,43
@@
static int verbose = 0;
*/
void fatalbox(char *fmt, ...)
{
*/
void fatalbox(char *fmt, ...)
{
- char
str[0x100]; /* Make the size big enough */
+ char
*str, *str2;
va_list ap;
va_start(ap, fmt);
va_list ap;
va_start(ap, fmt);
- strcpy(str, "Fatal:");
- vsprintf(str + strlen(str), fmt, ap);
+ str = dupvprintf(fmt, ap);
+ str2 = dupcat("Fatal: ", str, "\n", NULL);
+ sfree(str);
va_end(ap);
va_end(ap);
-
strcat(str, "\n"
);
-
fputs(str, stderr
);
+
fputs(str2, stderr
);
+
sfree(str2
);
cleanup_exit(1);
}
void modalfatalbox(char *fmt, ...)
{
cleanup_exit(1);
}
void modalfatalbox(char *fmt, ...)
{
- char
str[0x100]; /* Make the size big enough */
+ char
*str, *str2;
va_list ap;
va_start(ap, fmt);
va_list ap;
va_start(ap, fmt);
- strcpy(str, "Fatal:");
- vsprintf(str + strlen(str), fmt, ap);
+ str = dupvprintf(fmt, ap);
+ str2 = dupcat("Fatal: ", str, "\n", NULL);
+ sfree(str);
va_end(ap);
va_end(ap);
-
strcat(str, "\n"
);
-
fputs(str, stderr
);
+
fputs(str2, stderr
);
+
sfree(str2
);
cleanup_exit(1);
}
void connection_fatal(void *frontend, char *fmt, ...)
{
cleanup_exit(1);
}
void connection_fatal(void *frontend, char *fmt, ...)
{
- char
str[0x100]; /* Make the size big enough */
+ char
*str, *str2;
va_list ap;
va_start(ap, fmt);
va_list ap;
va_start(ap, fmt);
- strcpy(str, "Fatal:");
- vsprintf(str + strlen(str), fmt, ap);
+ str = dupvprintf(fmt, ap);
+ str2 = dupcat("Fatal: ", str, "\n", NULL);
+ sfree(str);
va_end(ap);
va_end(ap);
-
strcat(str, "\n"
);
-
fputs(str, stderr
);
+
fputs(str2, stderr
);
+
sfree(str2
);
cleanup_exit(1);
}
cleanup_exit(1);
}
@@
-1769,6
+1772,7
@@
static int psftp_connect(char *userhost, char *user, int portnumber)
}
if (!cfg.username[0]) {
printf("login as: ");
}
if (!cfg.username[0]) {
printf("login as: ");
+ fflush(stdout);
if (!fgets(cfg.username, sizeof(cfg.username), stdin)) {
fprintf(stderr, "psftp: aborting\n");
cleanup_exit(1);
if (!fgets(cfg.username, sizeof(cfg.username), stdin)) {
fprintf(stderr, "psftp: aborting\n");
cleanup_exit(1);