projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Integrate unfix.org's IPv6 patches up to level 10, with rather a lot
[u/mdw/putty]
/
windows
/
winmisc.c
diff --git
a/windows/winmisc.c
b/windows/winmisc.c
index
518eb15
..
c8b92a6
100644
(file)
--- a/
windows/winmisc.c
+++ b/
windows/winmisc.c
@@
-50,8
+50,14
@@
char *get_username(void)
char *user;
namelen = 0;
char *user;
namelen = 0;
- if (GetUserName(NULL, &namelen) == FALSE)
- return NULL;
+ if (GetUserName(NULL, &namelen) == FALSE) {
+ /*
+ * Apparently this doesn't work at least on Windows XP SP2.
+ * Thus assume a maximum of 256. It will fail again if it
+ * doesn't fit.
+ */
+ namelen = 256;
+ }
user = snewn(namelen, char);
GetUserName(user, &namelen);
user = snewn(namelen, char);
GetUserName(user, &namelen);