<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:ymaps="http://api.maps.yahoo.com/Maps/V2/AnnotatedMaps.xsd">

<channel>
	<title>Square Galaxy &#187; c</title>
	<atom:link href="http://squaregalaxy.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://squaregalaxy.com</link>
	<description>A blog by Jacob</description>
	<lastBuildDate>Thu, 04 Mar 2010 04:55:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>atoi(getenv(&#8220;MYVAR&#8221;))</title>
		<link>http://squaregalaxy.com/tech/atoi-getenv-myvar-linux-init/</link>
		<comments>http://squaregalaxy.com/tech/atoi-getenv-myvar-linux-init/#comments</comments>
		<pubDate>Wed, 28 May 2008 22:34:05 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://jacob.peargrove.com/tech/?p=88</guid>
		<description><![CDATA[These are mostly personal notes.  I&#8217;m not sure if they will make sense to others.
I had a problem with a line of code like this:
int x = atoi(getenv("MYVAR"));
If this line was in daemon-ized code started at init level 2, it would segfault.  (I&#8217;m not sure if these conditions are necessary, but those were [...]


Related posts:<ol><li><a href='http://squaregalaxy.com/tech/cross-post-code/' rel='bookmark' title='Permanent Link: Cross post code'>Cross post code</a> <small>I&#8217;ve implemented a method which will automatically take posts I...</small></li>
<li><a href='http://squaregalaxy.com/tech/what-bothers-you-most-about-this-code/' rel='bookmark' title='Permanent Link: What bothers you most about this code?'>What bothers you most about this code?</a> <small>I came across this line of code today, and while...</small></li>
<li><a href='http://squaregalaxy.com/tech/gdocsuploader/' rel='bookmark' title='Permanent Link: Gdocsuploader'>Gdocsuploader</a> <small>A while ago, I found myself needing to upload many...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>These are mostly personal notes.  I&#8217;m not sure if they will make sense to others.</p>
<p>I had a problem with a line of code like this:<br />
<code>int x = atoi(getenv("MYVAR"));</code></p>
<p>If this line was in daemon-ized code started at init level 2, it would segfault.  (I&#8217;m not sure if these conditions are necessary, but those were my conditions).</p>
<p><code>getenv("UNKNOWN_VAR") == NULL</code><br />
<code>atoi(NULL)</code> <strong>should </strong><code>== 0</code></p>
<p>But for some reason, things were segfaulting.  I corrected the problem with:<br />
<code>if (getenv("MYVAR") == NULL) int x = 0;<br />
else int x = atoi(getenv("MYVAR"));</code></p>

<p>Related posts:<ol><li><a href='http://squaregalaxy.com/tech/cross-post-code/' rel='bookmark' title='Permanent Link: Cross post code'>Cross post code</a> <small>I&#8217;ve implemented a method which will automatically take posts I...</small></li>
<li><a href='http://squaregalaxy.com/tech/what-bothers-you-most-about-this-code/' rel='bookmark' title='Permanent Link: What bothers you most about this code?'>What bothers you most about this code?</a> <small>I came across this line of code today, and while...</small></li>
<li><a href='http://squaregalaxy.com/tech/gdocsuploader/' rel='bookmark' title='Permanent Link: Gdocsuploader'>Gdocsuploader</a> <small>A while ago, I found myself needing to upload many...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://squaregalaxy.com/tech/atoi-getenv-myvar-linux-init/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What bothers you most about this code?</title>
		<link>http://squaregalaxy.com/tech/what-bothers-you-most-about-this-code/</link>
		<comments>http://squaregalaxy.com/tech/what-bothers-you-most-about-this-code/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 19:59:56 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[question]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://jacob.peargrove.com/tech/?p=75</guid>
		<description><![CDATA[I came across this line of code today, and while I don&#8217;t normally hate other people&#8217;s coding style, this one has something in it that really bothers me:
i = ((unsigned int)(crcAccum &#62;&#62; 24) ^ *dataBlkPtr++ ) &#38; 0xff;

Related posts:Cross post code I&#8217;ve implemented a method which will automatically take posts I...
Harvest the code I thought [...]


Related posts:<ol><li><a href='http://squaregalaxy.com/tech/cross-post-code/' rel='bookmark' title='Permanent Link: Cross post code'>Cross post code</a> <small>I&#8217;ve implemented a method which will automatically take posts I...</small></li>
<li><a href='http://squaregalaxy.com/tech/harvest-the-code/' rel='bookmark' title='Permanent Link: Harvest the code'>Harvest the code</a> <small>I thought I would throw a few marbles around about...</small></li>
<li><a href='http://squaregalaxy.com/tech/atoi-getenv-myvar-linux-init/' rel='bookmark' title='Permanent Link: atoi(getenv(&#8220;MYVAR&#8221;))'>atoi(getenv(&#8220;MYVAR&#8221;))</a> <small>These are mostly personal notes. I&#8217;m not sure if they...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I came across this line of code today, and while I don&#8217;t normally hate other people&#8217;s coding style, this one has something in it that really bothers me:</p>
<pre>i = ((unsigned int)(crcAccum &gt;&gt; 24) ^ *dataBlkPtr++ ) &amp; 0xff;</pre>

<p>Related posts:<ol><li><a href='http://squaregalaxy.com/tech/cross-post-code/' rel='bookmark' title='Permanent Link: Cross post code'>Cross post code</a> <small>I&#8217;ve implemented a method which will automatically take posts I...</small></li>
<li><a href='http://squaregalaxy.com/tech/harvest-the-code/' rel='bookmark' title='Permanent Link: Harvest the code'>Harvest the code</a> <small>I thought I would throw a few marbles around about...</small></li>
<li><a href='http://squaregalaxy.com/tech/atoi-getenv-myvar-linux-init/' rel='bookmark' title='Permanent Link: atoi(getenv(&#8220;MYVAR&#8221;))'>atoi(getenv(&#8220;MYVAR&#8221;))</a> <small>These are mostly personal notes. I&#8217;m not sure if they...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://squaregalaxy.com/tech/what-bothers-you-most-about-this-code/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
