summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9caada1)
raw | patch | inline | side by side (parent: 9caada1)
author | Aleksei Zakharov <zakharov.a.g@yandex.ru> | |
Thu, 19 Oct 2017 07:25:34 +0000 (07:25 +0000) | ||
committer | Aleksei Zakharov <zakharov.a.g@yandex.ru> | |
Thu, 19 Oct 2017 07:25:34 +0000 (07:25 +0000) |
src/ceph.c | patch | blob | history |
diff --git a/src/ceph.c b/src/ceph.c
index 523bc75f45708a69ee7ace8e984abab8cdb707c4..0b064de3fe12fd193383344e27732cea7e75aa91 100644 (file)
--- a/src/ceph.c
+++ b/src/ceph.c
return 0;
}
-static int cut_suffix(char new_str[], size_t new_str_len, char const *str,
+static void cut_suffix(char *buffer, size_t buffer_size, char const *str,
char const *suffix) {
size_t str_len = strlen(str);
size_t offset = str_len - suffix_len + 1;
- if (offset > new_str_len) {
- offset = new_str_len;
+ if (offset > buffer_size) {
+ offset = buffer_size;
}
- sstrncpy(new_str, str, offset);
-
- return 0;
+ sstrncpy(buffer, str, offset);
}
/* count_parts returns the number of elements a "foo.bar.baz" style key has. */