Re: [OT] iscan compiled on debian10 works and compiled on debian11 does not work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



deloptes via tde-devels wrote:

> I ran through strace and there are few differences around threads and
> mmap, but as I am not so experienced, I can not decide if this is
> relevant.
> 

I did some debugging and pinpointed sscanf. It is not reading strings
properly.
Do you have any idea what could be the reason for this?

see attached for an example where the format and the string are from the
code and configuration respectively

TGH I do not understand why it is using %as there, but if %s is used it does
not parse the hex values properly and segfaults when printing the strings.

-- 
FCD6 3719 0FFB F1BF 38EA  4727 5348 5F1F DCFE BCB0
/* sscanf example */
#include <stdio.h>

int main (void)
{
      char sentence []="interpreter usb 0x04b8 0x0142 /usr/lib/esci/libesci-interpreter-perfection-v330 /usr/share/esci/esfwad.bin";

      unsigned int vendor;
      unsigned int product;
      char *library  = NULL;
      char *firmware = NULL;

      sscanf (sentence, "%*s %*s %x %x %as %as",
              &vendor, &product, &library, &firmware);

      printf ("vendor   %x\n", vendor);
      printf ("product  %x\n", product);
      printf ("library  %s\n", library);
      printf ("firmware %s\n", firmware);

  return 0;
}
____________________________________________________
tde-devels mailing list -- devels@xxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devels-leave@xxxxxxxxxxxxxxxxxx
Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/devels@xxxxxxxxxxxxxxxxxx

[Index of Archives]     [Trinity Users]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [KDE]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux