summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-05-29 06:06:35 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-05-29 06:06:35 -0700
commit836fed4c330495944e60398bf0863d3fef285c5b (patch)
tree6f53fef8435db70269f88289ec8cc42955a9332d /src/string.c
parentb20388c004c11b338ee2b6e41d3b3dd641842162 (diff)
parent34dddc58e1cfc8091907406ce3df943cdf03bd4d (diff)
downloadmruby-836fed4c330495944e60398bf0863d3fef285c5b.tar.gz
mruby-836fed4c330495944e60398bf0863d3fef285c5b.zip
Merge pull request #205 from monaka/pr-use-default-case-in-switch-statement
Use default case in switch statement.
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index 28513c15c..695b0d01c 100644
--- a/src/string.c
+++ b/src/string.c
@@ -4400,9 +4400,17 @@ mrb_str_conv_enc_opts(mrb_state *mrb, mrb_value str, mrb_encoding *from, mrb_enc
mrb_enc_associate(mrb, newstr, to);
return newstr;
- default:
+ case econv_invalid_byte_sequence:
+ case econv_undefined_conversion:
+ case econv_source_buffer_empty:
+ case econv_after_output:
+ case econv_incomplete_input:
/* some error, return original */
return str;
+
+ default:
+ mrb_bug("Internal Error: Invalid return value mrb_econv_convert.");
+ return str;
}
}