2
1

nfs-utils-1.2.3-susv3-legacy.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Use the strchr() function instead of the legacy index() function.
  2. Signed-off-by: Frederik Pasch <fpasch@googlemail.com>
  3. --- 1/utils/mountd/fsloc.c
  4. +++ 2/utils/mountd/fsloc.c
  5. @@ -126,7 +126,7 @@
  6. struct servers *rv=NULL;
  7. xlog(L_NOTICE, "method_list(%s)\n", data);
  8. - for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++)
  9. + for (ptr--, listsize=1; ptr; ptr=strchr(ptr, ':'), listsize++)
  10. ptr++;
  11. list = malloc(listsize * sizeof(char *));
  12. copy = strdup(data);
  13. --- 1/support/nfs/nfs_mntent.c
  14. +++ 2/support/nfs/nfs_mntent.c
  15. @@ -9,7 +9,7 @@
  16. */
  17. #include <stdio.h>
  18. -#include <string.h> /* for index */
  19. +#include <string.h> /* for strchr */
  20. #include <ctype.h> /* for isdigit */
  21. #include <sys/stat.h> /* for umask */
  22. @@ -163,7 +163,7 @@
  23. return NULL;
  24. mfp->mntent_lineno++;
  25. - s = index (buf, '\n');
  26. + s = strchr (buf, '\n');
  27. if (s == NULL) {
  28. /* Missing final newline? Otherwise extremely */
  29. /* long line - assume file was corrupted */
  30. @@ -171,7 +171,7 @@
  31. fprintf(stderr, _("[mntent]: warning: no final "
  32. "newline at the end of %s\n"),
  33. mfp->mntent_file);
  34. - s = index (buf, 0);
  35. + s = strchr (buf, 0);
  36. } else {
  37. mfp->mntent_errs = 1;
  38. goto err;
  39. --- 1/utils/mount/error.c
  40. +++ 2/utils/mount/error.c
  41. @@ -62,7 +62,7 @@
  42. char *tmp;
  43. if (estr) {
  44. - if ((ptr = index(estr, ':')))
  45. + if ((ptr = strchr(estr, ':')))
  46. estr = ++ptr;
  47. tmp = &errbuf[spos];