enc = enc->details.sdl_type->encode;
}
if (enc) {
- smart_str_appendl(buf, ZSTR_VAL(spaces.s), ZSTR_LEN(spaces.s));
+ if (spaces.s) {
+ smart_str_appendl(buf, ZSTR_VAL(spaces.s), ZSTR_LEN(spaces.s));
+ }
smart_str_appendc(buf, ' ');
smart_str_appendl(buf, type->encode->details.type_str, strlen(type->encode->details.type_str));
smart_str_appendl(buf, " _;\n", 4);
sdlAttributePtr attr;
ZEND_HASH_FOREACH_PTR(type->attributes, attr) {
- smart_str_appendl(buf, ZSTR_VAL(spaces.s), ZSTR_LEN(spaces.s));
+ if (spaces.s) {
+ smart_str_appendl(buf, ZSTR_VAL(spaces.s), ZSTR_LEN(spaces.s));
+ }
smart_str_appendc(buf, ' ');
if (attr->encode && attr->encode->details.type_str) {
smart_str_appends(buf, attr->encode->details.type_str);