- sscanf(str + 4, "%d%[%%, \t]%d%[%%, \t]%d", &r, s1, &g, s2, &b);
+
+ /**
+ * In the original file, the formatted data reading did not specify the string with width limitation.
+ * To prevent the possible overflow, we replace '%s' with '%32s' here.
+ */
+ sscanf(str + 4, "%d%32[%%, \t]%d%32[%%, \t]%d", &r, s1, &g, s2, &b);