diff options
author | Florian Festi <ffesti@redhat.com> | 2015-11-13 12:20:24 +0100 |
---|---|---|
committer | Florian Festi <ffesti@redhat.com> | 2015-11-13 12:34:57 +0100 |
commit | 73674678b2b96a36ec542ec3bc23b227c6129b5f (patch) | |
tree | 31ee437a5c112892979fad6a610558a90d44a31d /lib/headerfmt.c | |
parent | a8accc3d72686bad000eff1329f04dd9c194a70c (diff) | |
download | rpm-73674678b2b96a36ec542ec3bc23b227c6129b5f.tar.gz |
Include name of unknown tag in the error message when parsig a formar string
Resolves: rhbz#855305
Diffstat (limited to 'lib/headerfmt.c')
-rw-r--r-- | lib/headerfmt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/headerfmt.c b/lib/headerfmt.c index 9b3cc723c..6d913783a 100644 --- a/lib/headerfmt.c +++ b/lib/headerfmt.c @@ -390,7 +390,10 @@ static int parseFormat(headerSprintfArgs hsa, char * str, token->type = PTOK_TAG; if (findTag(hsa, token, start)) { - hsa->errmsg = _("unknown tag"); + /* Use static buffer as hsa->errmsg is const char * */ + static char errmsg[1024]; + snprintf(errmsg, 1024, _("unknown tag: \"%s\""), start); + hsa->errmsg = (const char *)(&errmsg); goto errxit; } |