Value returned by "as_string_val_tostring" contains string inside double quotes

Dear team,

I’m using “aerospike-client-c-4.4.1-1.el6.x86_64” and I’ve noticed that “as_string_val_tostring” returns the string along with the double quotes. Although the problem is solved if I use “as_string_fromval” but this didn’t seem right therefore wanted to highlight. Please check.

as_string_val_tostring() can’t be changed for legacy reasons. External applications, including aql and asbackup, rely on the double quotes being there. It would be dangerous to change it at this point.

as_string_val_tostring() is not the most efficient choice anyhow, because each returned “char*” is created with an extra malloc(). If you have an as_string instance, you can access the underlying “char*” value without needing malloc()/free().

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.