]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - blob.c
aft.c: Use correct format string for error output.
[paraslash.git] / blob.c
diff --git a/blob.c b/blob.c
index 2e0a4762bfd1e34d0f12c7a9b2d4de582c8316d4..737f198013bdb4ae0ade08768a602b3c74c4323c 100644 (file)
--- a/blob.c
+++ b/blob.c
@@ -487,7 +487,8 @@ static int blob_get_name_by_id(struct osl_table *table, uint32_t id,
        struct osl_object obj = {.data = &id, .size = sizeof(id)};
        int ret;
 
-       *name = NULL;
+       if (name)
+               *name = NULL;
        if (!id)
                return 1;
        ret = osl(osl_get_row(table, BLOBCOL_ID, &obj, &row));
@@ -496,7 +497,10 @@ static int blob_get_name_by_id(struct osl_table *table, uint32_t id,
        ret = osl(osl_get_object(table, row, BLOBCOL_NAME, &obj));
        if (ret < 0)
                return ret;
-       *name = (char *)obj.data;
+       if (*(char *)obj.data == '\0')
+               return -E_DUMMY_ROW;
+       if (name)
+               *name = (char *)obj.data;
        return 1;
 }