This is the mail archive of the
mailing list for the GCC project.
sprintf warning on overlapping output
- From: Bernd Edlinger <bernd at edlinger-online dot de>
- To: Martin Sebor <msebor at redhat dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sun, 25 Sep 2016 11:46:01 +0200
- Subject: sprintf warning on overlapping output
- Authentication-results: sourceware.org; auth=none
in the past I have seen (and fixed) code like
sprintf(buf, "%s %d", buf, x);
that may possibly work by chance, but usually
produces undefined results.
Do you see a way to enhance the warning for cases
where the output buffer overlaps an input buffer?