short_src is a limited value, and also an byte array
instead of a pointer so it should not be returned.
Found by coverity.
/* basename would be better, but basename needs memory
allocation, since it might modify the buffer contents,
so we use this which is good enough */
- if ((ptr = strrchr(ar.short_src, '/')) == NULL)
- ptr = ar.short_src;
+ if (ar.source[0] != '@')
+ ptr = "<non-file location>";
+ else if ((ptr = strrchr(ar.source, '/')) == NULL)
+ ptr = ar.source;
else
ptr++;
*file_r = ptr;