Skip to content

Commit 74c7def

Browse files
committed
fix sprintf WIP
1 parent 50b1ce8 commit 74c7def

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/main/java/org/perlonjava/operators/SprintfFormatParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void validateSpecifier(FormatSpecifier spec) {
323323
// Check for vector formats FIRST (before %n check)
324324
if (spec.vectorFlag) {
325325
// Vector flag is only valid with certain conversions
326-
String validVectorConversions = "diouxXbBs";
326+
String validVectorConversions = "diouxXbB"; // Remove 's'
327327
System.err.println("DEBUG: Checking vector conversion '" + spec.conversionChar +
328328
"' in '" + validVectorConversions + "'");
329329
if (validVectorConversions.indexOf(spec.conversionChar) < 0) {

src/main/java/org/perlonjava/operators/SprintfOperator.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ private static int updateArgIndex(SprintfFormatParser.FormatSpecifier spec,
338338
* Handle invalid format specifiers.
339339
*/
340340
private static String handleInvalidSpecifier(SprintfFormatParser.FormatSpecifier spec) {
341-
System.err.println("DEBUG handleInvalidSpecifier: raw='" + spec.raw +
342-
"', errorMessage='" + spec.errorMessage + "'");
343341
String formatOnly = spec.raw;
344342
String trailing = "";
345343

@@ -371,8 +369,6 @@ private static String handleInvalidSpecifier(SprintfFormatParser.FormatSpecifier
371369
}
372370

373371
// Don't consume any arguments for invalid specifiers
374-
// The caller should NOT update argIndex for invalid formats
375-
376372
return formatOnly + trailing;
377373
}
378374

0 commit comments

Comments
 (0)