[mw-devel] [Git][arthur/mw][master] Fix a format overflow warning

Andrew Price welshbyte at sucs.org
Tue Aug 1 14:33:15 BST 2017


Andrew Price pushed to branch master at Justin Mitchell / mw


Commits:
26c2a8df by Andrew Price at 2017-08-01T14:30:55+01:00
Fix a format overflow warning

On gcc 7:

edit.c: In function ‘edit_user’:
edit.c:391:24: error: ‘sprintf’ writing a terminating nul past the end of the destination [-Werror=format-overflow=]
    sprintf(text, "s%05d", newroom);

- - - - -


1 changed file:

- src/client/edit.c


Changes:

=====================================
src/client/edit.c
=====================================
--- a/src/client/edit.c
+++ b/src/client/edit.c
@@ -366,7 +366,7 @@ void edit_user(const char *args, const char *name)
 	if (stringcmp(args,"room",2))
 	{
 		char	room[5];
-		char	text[6];
+		char	text[7];
 		int	newroom;
 		int	oldroom;
 



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/26c2a8df5af775fba08b2560c7c10ae381ff624c

---
View it on GitLab: https://projects.sucs.org/arthur/mw/commit/26c2a8df5af775fba08b2560c7c10ae381ff624c
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20170801/327a8c13/attachment.html>


More information about the mw-devel mailing list