diff options
author | Daniel Mierswa | 2009-08-17 07:27:39 +0200 |
---|---|---|
committer | Karel Zak | 2009-08-17 11:15:59 +0200 |
commit | c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed (patch) | |
tree | 6d4671545542031f67face36783f8ad64b29057c /fdisk/sfdisk.c | |
parent | libblkid: fix cache->probe memory leak (diff) | |
download | kernel-qcow2-util-linux-c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed.tar.gz kernel-qcow2-util-linux-c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed.tar.xz kernel-qcow2-util-linux-c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed.zip |
replace bcopy,bzero,index and rindex
Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in
POSIX.1-2008.
Replaced with memmove,memset,strchr and strrchr.
Signed-off-by: Daniel Mierswa <impulze@impulze.org>
Diffstat (limited to 'fdisk/sfdisk.c')
-rw-r--r-- | fdisk/sfdisk.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c index da779aa89..8fae5bb54 100644 --- a/fdisk/sfdisk.c +++ b/fdisk/sfdisk.c @@ -40,7 +40,7 @@ #include <unistd.h> /* read, write */ #include <fcntl.h> /* O_RDWR */ #include <errno.h> /* ERANGE */ -#include <string.h> /* index() */ +#include <string.h> /* strchr(), strrchr() */ #include <ctype.h> #include <getopt.h> #include <sys/ioctl.h> @@ -1725,12 +1725,12 @@ read_stdin(char **fields, char *line, int fieldssize, int linesize) { 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 */ @@ -1740,7 +1740,7 @@ read_stdin(char **fields, char *line, int fieldssize, int linesize) { } /* dump style? - then bad input is fatal */ - if ((ip = index(line+2, ':')) != 0) { + if ((ip = strchr(line+2, ':')) != 0) { struct dumpfld *d; nxtfld: @@ -2503,7 +2503,7 @@ main(int argc, char **argv) { if (argc < 1) fatal(_("no command?\n")); - if ((progn = rindex(argv[0], '/')) == NULL) + if ((progn = strrchr(argv[0], '/')) == NULL) progn = argv[0]; else progn++; |