<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wesnoth.org/index.php?action=history&amp;feed=atom&amp;title=Talk%3ACodingStandards</id>
	<title>Talk:CodingStandards - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wesnoth.org/index.php?action=history&amp;feed=atom&amp;title=Talk%3ACodingStandards"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Talk:CodingStandards&amp;action=history"/>
	<updated>2026-05-06T00:02:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Talk:CodingStandards&amp;diff=57660&amp;oldid=prev</id>
		<title>Dugi: /* Obsolete? */ new section</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Talk:CodingStandards&amp;diff=57660&amp;oldid=prev"/>
		<updated>2016-03-31T13:24:15Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Obsolete?: &lt;/span&gt; new section&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:24, 31 March 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot; &gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The correct (but annoying and non-portable solution) is to use the new &amp;quot;l&amp;quot; versions of these functions -- strlcpy, slprintf, etc.&amp;#160; But these are not standards.&amp;#160; And Microsoft invented their own version of all of them with different names for the MSVC7/8 libraries.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The correct (but annoying and non-portable solution) is to use the new &amp;quot;l&amp;quot; versions of these functions -- strlcpy, slprintf, etc.&amp;#160; But these are not standards.&amp;#160; And Microsoft invented their own version of all of them with different names for the MSVC7/8 libraries.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Obsolete? ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The C++11 banning part is clearly obsolete, C++11 is currently supported pretty much everywhere and I have found C++11 specific code in wesnoth's source code (this might be new, because the cmake script is not yet updated to compile it and crashes that it can't compile 'nullptr').&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dugi</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Talk:CodingStandards&amp;diff=25300&amp;oldid=prev</id>
		<title>Faultline: Start discussion about snprintf</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Talk:CodingStandards&amp;diff=25300&amp;oldid=prev"/>
		<updated>2008-04-13T05:06:23Z</updated>

		<summary type="html">&lt;p&gt;Start discussion about snprintf&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;* snprintf considered harmful&lt;br /&gt;
&lt;br /&gt;
Wesnoth's coding standards suggest using snprintf instead of sprintf.  But snprintf does not guarantee null termination on all platforms -- notably, not on Windows / MSVC6 ( ref: http://www.derkeiler.com/Mailing-Lists/securityfocus/vuln-dev/2002-05/0505.html ).  And some &amp;quot;n&amp;quot; string functions (notably strncpy) have guarantee the buffer is filled with nulls following the copied data, which is usually innocuous but can be nasty if you have a large buffer in an inner loop ---&lt;br /&gt;
&lt;br /&gt;
 /* example code */&lt;br /&gt;
 char buf[512];&lt;br /&gt;
 &lt;br /&gt;
 strncpy( buf, sizeof(buf), ps ); /* &amp;lt;-- always writes all 512 bytes! */&lt;br /&gt;
 &lt;br /&gt;
 /* ensure termination */&lt;br /&gt;
 buf[ sizeof(buf) - 1 ] = '\0';&lt;br /&gt;
&lt;br /&gt;
The correct (but annoying and non-portable solution) is to use the new &amp;quot;l&amp;quot; versions of these functions -- strlcpy, slprintf, etc.  But these are not standards.  And Microsoft invented their own version of all of them with different names for the MSVC7/8 libraries.&lt;/div&gt;</summary>
		<author><name>Faultline</name></author>
		
	</entry>
</feed>