Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-projects commit in portage-utils: main.c
Date: Sat, 13 Sep 2008 18:58:31
Message-Id: E1KeaKC-00052a-N4@stork.gentoo.org
1 grobian 08/09/13 18:58:28
2
3 Modified: main.c
4 Log:
5 strnlen is a GNU extension, use strlen instead.
6
7 Revision Changes Path
8 1.156 portage-utils/main.c
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/main.c?rev=1.156&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/main.c?rev=1.156&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/main.c?r1=1.155&r2=1.156
13
14 Index: main.c
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-projects/portage-utils/main.c,v
17 retrieving revision 1.155
18 retrieving revision 1.156
19 diff -u -r1.155 -r1.156
20 --- main.c 11 May 2008 17:25:00 -0000 1.155
21 +++ main.c 13 Sep 2008 18:58:28 -0000 1.156
22 @@ -1,7 +1,7 @@
23 /*
24 * Copyright 2005-2008 Gentoo Foundation
25 * Distributed under the terms of the GNU General Public License v2
26 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.155 2008/05/11 17:25:00 solar Exp $
27 + * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.156 2008/09/13 18:58:28 grobian Exp $
28 *
29 * Copyright 2005-2008 Ned Ludd - <solar@g.o>
30 * Copyright 2005-2008 Mike Frysinger - <vapier@g.o>
31 @@ -482,14 +482,14 @@
32 strncat(portroot, "/", sizeof(portroot));
33
34 f = 0;
35 - profilelen = readlink("/etc/make.profile", profile, sizeof(profile));
36 + profilelen = readlink("/etc/make.profile", profile, sizeof(profile) - 1);
37 if (profilelen == -1)
38 strcpy(profile, "/etc/make.profile");
39 else
40 profile[profilelen]='\0';
41
42 if (profile[0] != '/') {
43 - memmove(profile+5, profile, strnlen(profile, (size_t)profilelen)+1);
44 + memmove(profile+5, profile, strlen(profile)+1);
45 memcpy(profile, "/etc/", 5);
46 }
47 do {