patch-text-utils_parse_c 1.2 KB

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