From a022e6ebdba0cf5e08d101af235b7e6eaebee34e Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 30 Aug 2009 20:26:15 -0700 Subject: Fixes for more discerning compilers. --- benchmarks/main.c | 5 ++++- src/upb_string.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/benchmarks/main.c b/benchmarks/main.c index df8298f..3d98a05 100644 --- a/benchmarks/main.c +++ b/benchmarks/main.c @@ -24,7 +24,10 @@ int main (int argc, char *argv[]) char *progname = argv[0]; if(lastslash) { *lastslash = '\0'; - chdir(argv[0]); + if(chdir(argv[0]) < 0) { + fprintf(stderr, "Error changing directory to %s.\n", argv[0]); + return 1; + } *lastslash = '/'; progname = lastslash + 3; /* "/b_" */ } diff --git a/src/upb_string.h b/src/upb_string.h index aa62575..505ac5b 100644 --- a/src/upb_string.h +++ b/src/upb_string.h @@ -96,7 +96,7 @@ INLINE struct upb_string *upb_strdup(struct upb_string *s) { return copy; } -INLINE struct upb_string *upb_strdupc(char *s) { +INLINE struct upb_string *upb_strdupc(const char *s) { struct upb_string *copy = upb_string_new(); copy->byte_len = strlen(s); upb_string_resize(copy, copy->byte_len); -- cgit v1.2.3