projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
libmemcached-1.0: fix #57 (cinttypes/inttypes.h)
[m6w6/libmemcached]
/
libmemcached
/
string.cc
diff --git
a/libmemcached/string.cc
b/libmemcached/string.cc
index 7826bd10d8840919b333d5d4e9a904db218534ad..b821aca61edcb1de951774d4a81b2ca1f75b19e5 100644
(file)
--- a/
libmemcached/string.cc
+++ b/
libmemcached/string.cc
@@
-115,7
+115,7
@@
memcached_string_st *memcached_string_create(Memcached *memc, memcached_string_s
return NULL;
}
return NULL;
}
-
self->options.is_initialized= true
;
+
memcached_set_initialized(self, true)
;
WATCHPOINT_ASSERT(self->string == self->end);
WATCHPOINT_ASSERT(self->string == self->end);
@@
-281,18
+281,20
@@
char *memcached_string_take_value(memcached_string_st *self)
{
char* value= NULL;
{
char* value= NULL;
- if (memcached_string_length(self))
+ assert_msg(self, "Invalid memcached_string_st");
+ if (self)
{
{
- assert_msg(self, "Invalid memcached_string_st");
- // If we fail at adding the null, we copy and move on
- if (memcached_success(memcached_string_append_null(self)))
+ if (memcached_string_length(self))
{
{
- return memcached_string_c_copy(self);
+ // If we fail at adding the null, we copy and move on
+ if (memcached_failed(memcached_string_append_null(self)))
+ {
+ return NULL;
+ }
+
+ value= self->string;
+ _init_string(self);
}
}
-
- value= self->string;
-
- _init_string(self);
}
return value;
}
return value;