Please check work of API with wrong input parameter:
(code above have successfully work and return "buffer" as string, but with length = 11)
cstr = (unsigned char*)malloc(sizeof(unsigned char) * 7); cstr[0] = 'b'; cstr[1] = 'u'; cstr[2] = 'f'; cstr[3] = 'f'; cstr[4] = 'e'; cstr[5] = 'r'; cstr[6] = '\0'; buf = eina_binbuf_manage_new_length(cstr, 7); if (buf == NULL) { free(cstr); return; } if (!eina_binbuf_insert_length(buf, "buf", 4, 1000)) { eina_binbuf_string_free(buf); eina_binbuf_free(buf); return; } if (11 != eina_binbuf_length_get(buf) || (strcmp(eina_binbuf_string_get(buf), "buffer"))) { eina_binbuf_string_free(buf); eina_binbuf_free(buf); return; }