1
0

patch-text-utils_parse_c 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- util-linux-2.12r.orig/text-utils/parse.c 2002-03-09 00:07:00.000000000 +0100
  3. +++ util-linux-2.12r/text-utils/parse.c 2008-10-16 12:51:11.000000000 +0200
  4. @@ -64,7 +64,7 @@ void addfile(char *name)
  5. exit(1);
  6. }
  7. while (fgets(buf, sizeof(buf), fp)) {
  8. - if ((p = index(buf, '\n')) == NULL) {
  9. + if ((p = strchr(buf, '\n')) == NULL) {
  10. (void)fprintf(stderr, _("hexdump: line too long.\n"));
  11. while ((ch = getchar()) != '\n' && ch != EOF);
  12. continue;
  13. @@ -171,7 +171,7 @@ int size(FS *fs)
  14. * skip any special chars -- save precision in
  15. * case it's a %s format.
  16. */
  17. - while (index(spec + 1, *++fmt));
  18. + while (strchr(spec + 1, *++fmt));
  19. if (*fmt == '.' && isdigit((unsigned char)*++fmt)) {
  20. prec = atoi(fmt);
  21. while (isdigit((unsigned char)*++fmt));
  22. @@ -244,10 +244,10 @@ void rewrite(FS *fs)
  23. if (fu->bcnt) {
  24. sokay = USEBCNT;
  25. /* skip to conversion character */
  26. - for (++p1; index(spec, *p1); ++p1);
  27. + for (++p1; strchr(spec, *p1); ++p1);
  28. } else {
  29. /* skip any special chars, field width */
  30. - while (index(spec + 1, *++p1));
  31. + while (strchr(spec + 1, *++p1));
  32. if (*p1 == '.' &&
  33. isdigit((unsigned char)*++p1)) {
  34. sokay = USEPREC;