fix asprintf when adding null cmd