summaryrefslogtreecommitdiff
path: root/mg_db.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg_db.c')
-rw-r--r--mg_db.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mg_db.c b/mg_db.c
index f511d9e..8a227d2 100644
--- a/mg_db.c
+++ b/mg_db.c
@@ -1018,7 +1018,9 @@ mgSQLString
mgDb::Build_cddbid(const mgSQLString& artist) const
{
char *s;
- asprintf(&s,"%ld-%.9s",random(),artist.original());
+ msprintf(&s,"%ld-%.9s",random(),artist.original());
+ if (!s)
+ msprintf(&s,"%ld-X",random());
mgSQLString result = mgSQLString(s);
free(s);
return result;