Prefer strncmp over strcmp
This commit is contained in:
parent
e03b68dd0c
commit
a86304783f
1 changed files with 2 additions and 2 deletions
|
@ -87,9 +87,9 @@ ffi_status(VALUE self, VALUE rb_feature, VALUE rb_path)
|
||||||
2) == -1) {
|
2) == -1) {
|
||||||
rb_syserr_fail(errno, "extattr_get_file");
|
rb_syserr_fail(errno, "extattr_get_file");
|
||||||
}
|
}
|
||||||
if (strcmp(enable_data, disable_data) == 0) {
|
if (strncmp(enable_data, disable_data, 1) == 0) {
|
||||||
return (ID2SYM(rb_intern("conflict")));
|
return (ID2SYM(rb_intern("conflict")));
|
||||||
} else if (strcmp(enable_data, "1") == 0) {
|
} else if (strncmp(enable_data, "1", 1) == 0) {
|
||||||
return (ID2SYM(rb_intern("enabled")));
|
return (ID2SYM(rb_intern("enabled")));
|
||||||
} else {
|
} else {
|
||||||
return (ID2SYM(rb_intern("disabled")));
|
return (ID2SYM(rb_intern("disabled")));
|
||||||
|
|
Loading…
Reference in a new issue