popt-1.19.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From 5d5e76d369a412bfb3d2cebb5fc0a7509cef878d Mon Sep 17 00:00:00 2001
  2. From: Rod Smith <rodsmith@rodsbooks.com>
  3. Date: Fri, 15 Apr 2022 18:10:14 -0400
  4. Subject: [PATCH] Fix failure & crash of sgdisk when compiled with latest popt
  5. (commit 740; presumably eventually release 1.19)
  6. ---
  7. gptcl.cc | 2 +-
  8. support.h | 2 +-
  9. 2 files changed, 2 insertions(+), 2 deletions(-)
  10. diff --git a/gptcl.cc b/gptcl.cc
  11. index 34c9421..0d578eb 100644
  12. --- a/gptcl.cc
  13. +++ b/gptcl.cc
  14. @@ -155,7 +155,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
  15. } // while
  16. // Assume first non-option argument is the device filename....
  17. - device = (char*) poptGetArg(poptCon);
  18. + device = strdup((char*) poptGetArg(poptCon));
  19. poptResetContext(poptCon);
  20. if (device != NULL) {
  21. diff --git a/support.h b/support.h
  22. index 8ba9ad1..f91f1bc 100644
  23. --- a/support.h
  24. +++ b/support.h
  25. @@ -8,7 +8,7 @@
  26. #include <stdlib.h>
  27. #include <string>
  28. -#define GPTFDISK_VERSION "1.0.9"
  29. +#define GPTFDISK_VERSION "1.0.9.1"
  30. #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
  31. // Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64