diff --git a/src/pocketpy.cpp b/src/pocketpy.cpp index 37284b63..27455846 100644 --- a/src/pocketpy.cpp +++ b/src/pocketpy.cpp @@ -734,6 +734,7 @@ void init_builtins(VM* _vm) { int delta = width - self.u8_length(); if(delta <= 0) return args[0]; const Str& fillchar = CAST(Str&, args[2]); + if (fillchar.u8_length() != 1) vm->TypeError("The fill character must be exactly one character long"); SStream ss; ss << self; for(int i=0; iTypeError("The fill character must be exactly one character long"); SStream ss; for(int i=0; i