@@ -1215,10 +1215,10 @@ int main(int argc, char **argv)
break;
case 's':
con_args[count].crtc = -1;
- if (sscanf(optarg, "%d:%64s",
+ if (sscanf(optarg, "%20d:%64s",
&con_args[count].id,
con_args[count].mode_str) != 2 &&
- sscanf(optarg, "%d@%d:%64s",
+ sscanf(optarg, "%20d@%20d:%64s",
&con_args[count].id,
&con_args[count].crtc,
con_args[count].mode_str) != 3)
@@ -1227,12 +1227,12 @@ int main(int argc, char **argv)
break;
case 'P':
strcpy(plane_args[plane_count].format_str, "XR24");
- if (sscanf(optarg, "%d:%dx%d@%4s",
+ if (sscanf(optarg, "%20d:%20dx%20d@%4s",
&plane_args[plane_count].con_id,
&plane_args[plane_count].w,
&plane_args[plane_count].h,
plane_args[plane_count].format_str) != 4 &&
- sscanf(optarg, "%d:%dx%d",
+ sscanf(optarg, "%20d:%20dx%20d",
&plane_args[plane_count].con_id,
&plane_args[plane_count].w,
&plane_args[plane_count].h) != 3)
@@ -224,18 +224,18 @@ static int drmMatchBusID(const char *id1, const char *id2, int pci_domain_ok)
unsigned int o2, b2, d2, f2;
int ret;
- ret = sscanf(id1, "pci:%04x:%02x:%02x.%u", &o1, &b1, &d1, &f1);
+ ret = sscanf(id1, "pci:%04x:%02x:%02x.%20u", &o1, &b1, &d1, &f1);
if (ret != 4) {
o1 = 0;
- ret = sscanf(id1, "PCI:%u:%u:%u", &b1, &d1, &f1);
+ ret = sscanf(id1, "PCI:%20u:%20u:%20u", &b1, &d1, &f1);
if (ret != 3)
return 0;
}
- ret = sscanf(id2, "pci:%04x:%02x:%02x.%u", &o2, &b2, &d2, &f2);
+ ret = sscanf(id2, "pci:%04x:%02x:%02x.%20u", &o2, &b2, &d2, &f2);
if (ret != 4) {
o2 = 0;
- ret = sscanf(id2, "PCI:%u:%u:%u", &b2, &d2, &f2);
+ ret = sscanf(id2, "PCI:%20u:%20u:%20u", &b2, &d2, &f2);
if (ret != 3)
return 0;
}
@@ -693,7 +693,7 @@ int drmCheckModesettingSupported(const char *busid)
struct dirent *dent;
int found = 0, ret;
- ret = sscanf(busid, "pci:%04x:%02x:%02x.%d", &domain, &bus, &dev, &func);
+ ret = sscanf(busid, "pci:%04x:%02x:%02x.%20d", &domain, &bus, &dev, &func);
if (ret != 4)
return -EINVAL;