Deleted Added
full compact
uudecode.c (28564) uudecode.c (29574)
1/*-
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)uudecode.c 8.2 (Berkeley) 4/2/94";
43#endif
44static const char rcsid[] =
1/*-
2 * Copyright (c) 1983, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 28 unchanged lines hidden (view full) ---

37 The Regents of the University of California. All rights reserved.\n";
38#endif /* not lint */
39
40#ifndef lint
41#if 0
42static char sccsid[] = "@(#)uudecode.c 8.2 (Berkeley) 4/2/94";
43#endif
44static const char rcsid[] =
45 "$Id$";
45 "$Id: uudecode.c,v 1.9 1997/08/22 06:51:43 charnier Exp $";
46#endif /* not lint */
47
48/*
49 * uudecode [file ...]
50 *
51 * create the specified file, decoding as you go.
52 * used with uuencode.
53 */

--- 101 unchanged lines hidden (view full) ---

155 (void)sscanf(buf, "begin %o %s", &mode, buf);
156
157 /* handle ~user/file format */
158 if (buf[0] == '~') {
159 if (!(p = index(buf, '/'))) {
160 warnx("%s: illegal ~user", filename);
161 return(1);
162 }
46#endif /* not lint */
47
48/*
49 * uudecode [file ...]
50 *
51 * create the specified file, decoding as you go.
52 * used with uuencode.
53 */

--- 101 unchanged lines hidden (view full) ---

155 (void)sscanf(buf, "begin %o %s", &mode, buf);
156
157 /* handle ~user/file format */
158 if (buf[0] == '~') {
159 if (!(p = index(buf, '/'))) {
160 warnx("%s: illegal ~user", filename);
161 return(1);
162 }
163 *p++ = NULL;
163 *p++ = '\0';
164 if (!(pw = getpwnam(buf + 1))) {
165 warnx("%s: no user %s", filename, buf);
166 return(1);
167 }
168 n = strlen(pw->pw_dir);
169 n1 = strlen(p);
170 if (n + n1 + 2 > MAXPATHLEN) {
171 warnx("%s: path too long", filename);

--- 96 unchanged lines hidden ---
164 if (!(pw = getpwnam(buf + 1))) {
165 warnx("%s: no user %s", filename, buf);
166 return(1);
167 }
168 n = strlen(pw->pw_dir);
169 n1 = strlen(p);
170 if (n + n1 + 2 > MAXPATHLEN) {
171 warnx("%s: path too long", filename);

--- 96 unchanged lines hidden ---