lib/text: `Text::format` uses an index starting at 0, as `Array` does
[nit.git] / lib / core / text / abstract_text.nit
index 4770977..4cf56ba 100644 (file)
@@ -988,7 +988,7 @@ abstract class Text
                                var fmt_end = i
                                var ciph_len = fmt_end - ciph_st + 1
 
-                               var arg_index = substring(ciph_st, ciph_len).to_i - 1
+                               var arg_index = substring(ciph_st, ciph_len).to_i
                                if arg_index >= args.length then continue
 
                                s.push substring(curr_st, fmt_st - curr_st)
@@ -1554,7 +1554,7 @@ end
 redef class Int
 
        # Wrapper of strerror C function
-       private fun strerror_ext: NativeString `{ return strerror(self); `}
+       private fun strerror_ext: NativeString `{ return strerror((int)self); `}
 
        # Returns a string describing error number
        fun strerror: String do return strerror_ext.to_s