hddtemp-0.3-beta15-byteswap.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  1. diff -Nuar --exclude '*~' hddtemp-0.3-beta15.orig/src/sata.c hddtemp-0.3-beta15/src/sata.c
  2. --- hddtemp-0.3-beta15.orig/src/sata.c 2006-05-14 02:09:55.579437498 -0700
  3. +++ hddtemp-0.3-beta15/src/sata.c 2006-05-14 02:06:08.495948437 -0700
  4. @@ -88,7 +88,9 @@
  5. return strdup(_("unknown"));
  6. else
  7. {
  8. + //fprintf(stderr,"sata_model1=%s\n",identify + 54);
  9. sata_fixstring(identify + 54, 24);
  10. + //fprintf(stderr,"sata_model2=%s\n",identify + 54);
  11. return strdup(identify + 54);
  12. }
  13. }
  14. diff -Nuar --exclude '*~' hddtemp-0.3-beta15.orig/src/satacmds.c hddtemp-0.3-beta15/src/satacmds.c
  15. --- hddtemp-0.3-beta15.orig/src/satacmds.c 2006-05-14 02:09:40.983470339 -0700
  16. +++ hddtemp-0.3-beta15/src/satacmds.c 2006-05-14 02:09:02.319557333 -0700
  17. @@ -98,7 +98,10 @@
  18. /* convert from big-endian to host byte order */
  19. for (p = end ; p != s;) {
  20. unsigned short *pp = (unsigned short *) (p -= 2);
  21. - *pp = ntohs(*pp);
  22. + char tmp = p[0];
  23. + p[0] = p[1];
  24. + p[1] = tmp;
  25. + //*pp = ntohs(*pp);
  26. }
  27. /* strip leading blanks */