~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Mention that Shift-Ins works here.
[sgt/putty]
/
x11fwd.c
diff --git
a/x11fwd.c
b/x11fwd.c
index
d632e55
..
4b043fa
100644
(file)
--- a/
x11fwd.c
+++ b/
x11fwd.c
@@
-189,8
+189,16
@@
char *x11_init(Socket * s, char *display, void *c, void *auth)
displaynum = 0; /* sensible default */
if (n > sizeof(host) - 1)
n = sizeof(host) - 1;
displaynum = 0; /* sensible default */
if (n > sizeof(host) - 1)
n = sizeof(host) - 1;
- strncpy(host, display, n);
- host[n] = '\0';
+ if (n > 0) {
+ strncpy(host, display, n);
+ host[n] = '\0';
+ } else {
+ /*
+ * Local display numbers, particularly on Unix, often omit
+ * the display part completely.
+ */
+ strcpy(host, "localhost");
+ }
/*
* Try to find host.
/*
* Try to find host.