If the given id equals the id of the dummy row, the function currently
returns an empty object. This is unfortunate, since blob table users
should not know about the dummy row implementation detail. This patch
makes the function return -E_DUMMY_ROW instead.
In error.h, the E_DUMMY_ROW error code was defined in the section
for mood.c because this file contains the only user of the error
code. With another user in blob.c it seems appropriate to move it to
the blob section instead.
ret = osl(osl_get_object(table, row, BLOBCOL_NAME, &obj));
if (ret < 0)
return ret;
+ if (*(char *)obj.data == '\0')
+ return -E_DUMMY_ROW;
*name = (char *)obj.data;
return 1;
}
#define MOOD_ERRORS \
PARA_ERROR(NO_MOOD, "no mood available"), \
- PARA_ERROR(DUMMY_ROW, "attempted to access blob dummy object"), \
#define MM_ERRORS \
#define BLOB_ERRORS \
PARA_ERROR(BLOB_SYNTAX, "blob syntax error"), \
+ PARA_ERROR(DUMMY_ROW, "attempted to access blob dummy object"), \
#define PLAYLIST_ERRORS \