123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- diff -ur util-linux-2.12r/fdisk/cfdisk.c util-linux-2.12r-patched/fdisk/cfdisk.c
- --- util-linux-2.12r/fdisk/cfdisk.c 2005-09-09 16:44:57.000000000 -0500
- +++ util-linux-2.12r-patched/fdisk/cfdisk.c 2006-12-04 23:21:09.646235820 -0600
- @@ -353,7 +353,7 @@
- /* Some libc's have their own basename() */
- static char *
- my_basename(char *devname) {
- - char *s = rindex(devname, '/');
- + char *s = strrchr(devname, '/');
- return s ? s+1 : devname;
- }
-
- diff -ur util-linux-2.12r/fdisk/fdiskbsdlabel.c util-linux-2.12r-patched/fdisk/fdiskbsdlabel.c
- --- util-linux-2.12r/fdisk/fdiskbsdlabel.c 2003-07-13 16:12:47.000000000 -0500
- +++ util-linux-2.12r-patched/fdisk/fdiskbsdlabel.c 2006-12-04 23:21:09.646235820 -0600
- @@ -538,10 +538,10 @@
-
- /* We need a backup of the disklabel (xbsd_dlabel might have changed). */
- d = &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE];
- - bcopy (d, &dl, sizeof (struct xbsd_disklabel));
- + memcpy (&dl, d, sizeof (struct xbsd_disklabel));
-
- /* The disklabel will be overwritten by 0's from bootxx anyway */
- - bzero (d, sizeof (struct xbsd_disklabel));
- + memset (d, 0, sizeof (struct xbsd_disklabel));
-
- snprintf (path, sizeof(path), "%s/boot%s", bootdir, dkbasename);
- if (!xbsd_get_bootstrap (path, &disklabelbuffer[xbsd_dlabel.d_secsize],
- @@ -555,7 +555,7 @@
- exit ( EXIT_FAILURE );
- }
-
- - bcopy (&dl, d, sizeof (struct xbsd_disklabel));
- + memcpy (d, &dl, sizeof (struct xbsd_disklabel));
-
- #if defined (__powerpc__) || defined (__hppa__)
- sector = 0;
- @@ -657,7 +657,7 @@
- struct geom g;
-
- get_geometry (fd, &g);
- - bzero (d, sizeof (struct xbsd_disklabel));
- + memset (d, 0, sizeof (struct xbsd_disklabel));
-
- d -> d_magic = BSD_DISKMAGIC;
-
- @@ -740,8 +740,8 @@
- if (BSD_BBSIZE != read (fd, disklabelbuffer, BSD_BBSIZE))
- fatal (unable_to_read);
-
- - bcopy (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
- - d, sizeof (struct xbsd_disklabel));
- + memcpy (d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
- + sizeof (struct xbsd_disklabel));
-
- if (d -> d_magic != BSD_DISKMAGIC || d -> d_magic2 != BSD_DISKMAGIC)
- return 0;
- @@ -776,7 +776,7 @@
- /* This is necessary if we want to write the bootstrap later,
- otherwise we'd write the old disklabel with the bootstrap.
- */
- - bcopy (d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET],
- + memcpy (&disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], d,
- sizeof (struct xbsd_disklabel));
-
- #if defined (__alpha__) && BSD_LABELSECTOR == 0
- diff -ur util-linux-2.12r/fdisk/sfdisk.c util-linux-2.12r-patched/fdisk/sfdisk.c
- --- util-linux-2.12r/fdisk/sfdisk.c 2005-01-04 16:31:57.000000000 -0600
- +++ util-linux-2.12r-patched/fdisk/sfdisk.c 2006-12-04 23:21:09.650236137 -0600
- @@ -1730,12 +1730,12 @@
- eof = 1;
- return RD_EOF;
- }
- - if (!(lp = index(lp, '\n')))
- + if (!(lp = strchr(lp, '\n')))
- fatal(_("long or incomplete input line - quitting\n"));
- *lp = 0;
-
- /* remove comments, if any */
- - if ((lp = index(line+2, '#')) != 0)
- + if ((lp = strchr(line+2, '#')) != 0)
- *lp = 0;
-
- /* recognize a few commands - to be expanded */
- @@ -1745,7 +1745,7 @@
- }
-
- /* dump style? - then bad input is fatal */
- - if ((ip = index(line+2, ':')) != 0) {
- + if ((ip = strchr(line+2, ':')) != 0) {
- struct dumpfld *d;
-
- nxtfld:
- @@ -2514,7 +2514,7 @@
-
- if (argc < 1)
- fatal(_("no command?\n"));
- - if ((progn = rindex(argv[0], '/')) == NULL)
- + if ((progn = strrchr(argv[0], '/')) == NULL)
- progn = argv[0];
- else
- progn++;
- diff -ur util-linux-2.12r/login-utils/login.c util-linux-2.12r-patched/login-utils/login.c
- --- util-linux-2.12r/login-utils/login.c 2004-12-04 20:37:12.000000000 -0600
- +++ util-linux-2.12r-patched/login-utils/login.c 2006-12-04 23:21:09.650236137 -0600
- @@ -97,8 +97,6 @@
- #include <sys/file.h>
- #include <termios.h>
- #include <string.h>
- -#define index strchr
- -#define rindex strrchr
- #include <sys/ioctl.h>
- #include <sys/wait.h>
- #include <signal.h>
- @@ -1192,7 +1190,7 @@
- childArgv[childArgc++] = buff;
- } else {
- tbuf[0] = '-';
- - xstrncpy(tbuf + 1, ((p = rindex(pwd->pw_shell, '/')) ?
- + xstrncpy(tbuf + 1, ((p = strrchr(pwd->pw_shell, '/')) ?
- p + 1 : pwd->pw_shell),
- sizeof(tbuf)-1);
-
- diff -ur util-linux-2.12r/login-utils/passwd.c util-linux-2.12r-patched/login-utils/passwd.c
- --- util-linux-2.12r/login-utils/passwd.c 2002-03-08 17:00:11.000000000 -0600
- +++ util-linux-2.12r-patched/login-utils/passwd.c 2006-12-04 23:21:09.650236137 -0600
- @@ -194,7 +194,7 @@
- if ( c-gecos && (g = (char *)malloc (c-gecos+1)) ) {
- strncpy (g, gecos, c-gecos);
- g[c-gecos] = 0;
- - while ( (c=rindex(g, ' ')) ) {
- + while ( (c=strrchr(g, ' ')) ) {
- if ( !check_passwd_string(passwd, c+1) ) {
- printf(_("Please don't use something like your realname as password!\n"));
- free (g);
- diff -ur util-linux-2.12r/login-utils/vipw.c util-linux-2.12r-patched/login-utils/vipw.c
- --- util-linux-2.12r/login-utils/vipw.c 2004-03-04 15:54:44.000000000 -0600
- +++ util-linux-2.12r-patched/login-utils/vipw.c 2006-12-04 23:21:09.650236137 -0600
- @@ -314,7 +314,7 @@
- textdomain(PACKAGE);
-
- bzero(tmp_file, FILENAMELEN);
- - progname = (rindex(argv[0], '/')) ? rindex(argv[0], '/') + 1 : argv[0];
- + progname = (strrchr(argv[0], '/')) ? strrchr(argv[0], '/') + 1 : argv[0];
- if (!strcmp(progname, "vigr")) {
- program = VIGR;
- xstrncpy(orig_file, GROUP_FILE, sizeof(orig_file));
- diff -ur util-linux-2.12r/login-utils/wall.c util-linux-2.12r-patched/login-utils/wall.c
- --- util-linux-2.12r/login-utils/wall.c 2002-03-08 17:00:19.000000000 -0600
- +++ util-linux-2.12r-patched/login-utils/wall.c 2006-12-04 23:21:09.650236137 -0600
- @@ -87,7 +87,7 @@
- textdomain(PACKAGE);
-
- progname = argv[0];
- - p = rindex(progname, '/');
- + p = strrchr(progname, '/');
- if (p)
- progname = p+1;
-
- diff -ur util-linux-2.12r/misc-utils/logger.c util-linux-2.12r-patched/misc-utils/logger.c
- --- util-linux-2.12r/misc-utils/logger.c 2004-09-06 16:13:49.000000000 -0500
- +++ util-linux-2.12r-patched/misc-utils/logger.c 2006-12-04 23:21:09.650236137 -0600
- @@ -198,7 +198,7 @@
- } else {
- if (p != buf)
- *p++ = ' ';
- - bcopy(*argv++, p, len);
- + memcpy(p, *argv++, len);
- *(p += len) = '\0';
- }
- }
- diff -ur util-linux-2.12r/misc-utils/whereis.c util-linux-2.12r-patched/misc-utils/whereis.c
- --- util-linux-2.12r/misc-utils/whereis.c 2001-03-15 04:09:58.000000000 -0600
- +++ util-linux-2.12r-patched/misc-utils/whereis.c 2006-12-04 23:21:09.650236137 -0600
- @@ -323,14 +323,14 @@
- char dirbuf[1024];
- struct stat statbuf;
-
- - dd = index(dir, '*');
- + dd = strchr(dir, '*');
- if (!dd)
- goto noglob;
-
- l = strlen(dir);
- if (l < sizeof(dirbuf)) { /* refuse excessively long names */
- strcpy (dirbuf, dir);
- - d = index(dirbuf, '*');
- + d = strchr(dirbuf, '*');
- *d = 0;
- dirp = opendir(dirbuf);
- if (dirp == NULL)
- diff -ur util-linux-2.12r/mount/mntent.c util-linux-2.12r-patched/mount/mntent.c
- --- util-linux-2.12r/mount/mntent.c 2004-10-13 15:57:34.000000000 -0500
- +++ util-linux-2.12r-patched/mount/mntent.c 2006-12-04 23:21:09.650236137 -0600
- @@ -158,7 +158,7 @@
- return NULL;
-
- mfp->mntent_lineno++;
- - s = index (buf, '\n');
- + s = strchr (buf, '\n');
- if (s == NULL) {
- /* Missing final newline? Otherwise extremely */
- /* long line - assume file was corrupted */
- @@ -166,7 +166,7 @@
- fprintf(stderr, _("[mntent]: warning: no final "
- "newline at the end of %s\n"),
- mfp->mntent_file);
- - s = index (buf, 0);
- + s = strchr (buf, 0);
- } else {
- mfp->mntent_errs = 1;
- goto err;
- diff -ur util-linux-2.12r/mount/mount.c util-linux-2.12r-patched/mount/mount.c
- --- util-linux-2.12r/mount/mount.c 2004-12-21 16:00:36.000000000 -0600
- +++ util-linux-2.12r-patched/mount/mount.c 2006-12-04 23:21:09.654236454 -0600
- @@ -488,11 +488,11 @@
-
- /* Accept a comma-separated list of types, and try them one by one */
- /* A list like "nonfs,.." indicates types not to use */
- - if (*types && strncmp(*types, "no", 2) && index(*types,',')) {
- + if (*types && strncmp(*types, "no", 2) && strchr(*types,',')) {
- char *t = strdup(*types);
- char *p;
-
- - while((p = index(t,',')) != NULL) {
- + while((p = strchr(t,',')) != NULL) {
- *p = 0;
- args.type = *types = t;
- if(do_mount_syscall (&args) == 0)
- diff -ur util-linux-2.12r/mount/mount_by_label.c util-linux-2.12r-patched/mount/mount_by_label.c
- --- util-linux-2.12r/mount/mount_by_label.c 2004-12-21 17:15:33.000000000 -0600
- +++ util-linux-2.12r-patched/mount/mount_by_label.c 2006-12-04 23:21:09.654236454 -0600
- @@ -213,7 +213,7 @@
- fseek(procpt, 0, SEEK_SET);
-
- while (fgets(line, sizeof(line), procpt)) {
- - if (!index(line, '\n'))
- + if (!strchr(line, '\n'))
- break;
-
- if (sscanf (line, " %d %d %d %[^\n ]",
- diff -ur util-linux-2.12r/mount/sundries.c util-linux-2.12r-patched/mount/sundries.c
- --- util-linux-2.12r/mount/sundries.c 2004-12-21 13:12:31.000000000 -0600
- +++ util-linux-2.12r-patched/mount/sundries.c 2006-12-04 23:21:09.654236454 -0600
- @@ -138,7 +138,7 @@
- if (strncmp(p, type, len) == 0 &&
- (p[len] == 0 || p[len] == ','))
- return !no;
- - p = index(p,',');
- + p = strchr(p,',');
- if (!p)
- break;
- p++;
- diff -ur util-linux-2.12r/mount/umount.c util-linux-2.12r-patched/mount/umount.c
- --- util-linux-2.12r/mount/umount.c 2005-09-10 13:07:38.000000000 -0500
- +++ util-linux-2.12r-patched/mount/umount.c 2006-12-04 23:21:09.654236454 -0600
- @@ -338,7 +338,7 @@
- if (res < 0)
- umnt_err2 = errno;
- /* Do not complain about remote NFS mount points */
- - if (errno == ENOENT && index(spec, ':'))
- + if (errno == ENOENT && strchr(spec, ':'))
- umnt_err2 = 0;
- }
- }
- diff -ur util-linux-2.12r/text-utils/colcrt.c util-linux-2.12r-patched/text-utils/colcrt.c
- --- util-linux-2.12r/text-utils/colcrt.c 2001-03-15 04:09:59.000000000 -0600
- +++ util-linux-2.12r-patched/text-utils/colcrt.c 2006-12-04 23:23:45.614600041 -0600
- @@ -252,8 +252,8 @@
- }
- putwchar('\n');
- }
- - bcopy(page[ol], page, (267 - ol) * 132 * sizeof(wchar_t));
- - bzero(page[267- ol], ol * 132 * sizeof(wchar_t));
- + memcpy(page, page[ol], (267 - ol) * 132 * sizeof(wchar_t));
- + memset(page[267- ol], 0, ol * 132 * sizeof(wchar_t));
- outline -= ol;
- outcol = 0;
- first = 1;
- diff -ur util-linux-2.12r/text-utils/display.c util-linux-2.12r-patched/text-utils/display.c
- --- util-linux-2.12r/text-utils/display.c 2002-03-08 17:05:39.000000000 -0600
- +++ util-linux-2.12r-patched/text-utils/display.c 2006-12-04 23:24:32.478315487 -0600
- @@ -163,7 +163,7 @@
- pr->cchar[0] = 's';
- pr->cchar[1] = 0;
- for (p1 = pr->fmt; *p1 != '%'; ++p1);
- - for (p2 = ++p1; *p1 && index(spec, *p1); ++p1);
- + for (p2 = ++p1; *p1 && strchr(spec, *p1); ++p1);
- while ((*p2++ = *p1++) != 0) ;
- }
-
- diff -ur util-linux-2.12r/text-utils/parse.c util-linux-2.12r-patched/text-utils/parse.c
- --- util-linux-2.12r/text-utils/parse.c 2002-03-08 17:07:00.000000000 -0600
- +++ util-linux-2.12r-patched/text-utils/parse.c 2006-12-04 23:24:19.913319294 -0600
- @@ -64,7 +64,7 @@
- exit(1);
- }
- while (fgets(buf, sizeof(buf), fp)) {
- - if ((p = index(buf, '\n')) == NULL) {
- + if ((p = strchr(buf, '\n')) == NULL) {
- (void)fprintf(stderr, _("hexdump: line too long.\n"));
- while ((ch = getchar()) != '\n' && ch != EOF);
- continue;
- @@ -171,7 +171,7 @@
- * skip any special chars -- save precision in
- * case it's a %s format.
- */
- - while (index(spec + 1, *++fmt));
- + while (strchr(spec + 1, *++fmt));
- if (*fmt == '.' && isdigit((unsigned char)*++fmt)) {
- prec = atoi(fmt);
- while (isdigit((unsigned char)*++fmt));
- @@ -244,10 +244,10 @@
- if (fu->bcnt) {
- sokay = USEBCNT;
- /* skip to conversion character */
- - for (++p1; index(spec, *p1); ++p1);
- + for (++p1; strchr(spec, *p1); ++p1);
- } else {
- /* skip any special chars, field width */
- - while (index(spec + 1, *++p1));
- + while (strchr(spec + 1, *++p1));
- if (*p1 == '.' &&
- isdigit((unsigned char)*++p1)) {
- sokay = USEPREC;
|