Skip to content
Snippets Groups Projects
Commit 59a9424e authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

add assert to resolve unckeched return, CID 997072

parent 9c8cce13
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
......@@ -94,7 +95,10 @@ static char *path_relative_to(const char *filename, const char *reference)
if (!result)
return NULL;
snprintf(result, result_len, "%.*s/%s", path_len, reference, filename);
int w;
w = snprintf(result, result_len, "%.*s/%s", path_len, reference, filename);
assert(w + 1 == result_len);
return result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment