X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fruserpass.c;h=3097ee7f9f4be2413d7aa9dd6fec90aa88e30bae;hp=6045c326ba9adbf389a9e991d228fafac0868d1c;hb=d2da15ecabb03fb2de72863abdf5f21e52fdf329;hpb=e0233d70fb7bfac996b3514ae60d7eedef0e6ad3 diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 6045c32..3097ee7 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -1,4 +1,5 @@ /* + * Portions of this code are * Copyright (c) 1985 Regents of the University of California. * All rights reserved. * @@ -18,6 +19,7 @@ */ #include +#include #include #include @@ -65,7 +67,6 @@ ruserpass(char *host, char **aname, char **apass) char *hdir, buf[BUFSIZ]; int t, usedefault = 0; struct stat stb; - extern int errno; hdir = getenv("HOME"); if (hdir == NULL) @@ -100,7 +101,7 @@ match: switch(t) { case LOGIN: if (token() && *aname == 0) { - *aname = malloc((size_t) strlen(tokval) + 1); + *aname = mh_xmalloc((size_t) strlen(tokval) + 1); strcpy(*aname, tokval); } break; @@ -112,7 +113,7 @@ match: goto bad; } if (token() && *apass == 0) { - *apass = malloc((size_t) strlen(tokval) + 1); + *apass = mh_xmalloc((size_t) strlen(tokval) + 1); strcpy(*apass, tokval); } break; @@ -153,7 +154,7 @@ done: myname = tmp; } - *aname = malloc((size_t) strlen(myname) + 1); + *aname = mh_xmalloc((size_t) strlen(myname) + 1); strcpy (*aname, myname); } @@ -168,7 +169,7 @@ done: mypass = *aname; } - *apass = malloc((size_t) strlen(mypass) + 1); + *apass = mh_xmalloc((size_t) strlen(mypass) + 1); strcpy (*apass, mypass); }