<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to make sure sscanf reads to the end of the line</title>
	<atom:link href="http://blogs.gnome.org/tthurman/2008/03/21/sscanf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/tthurman/2008/03/21/sscanf/</link>
	<description>Thomas Thurman does not like cold meals because of broken applications.</description>
	<lastBuildDate>Fri, 30 Jul 2010 12:08:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Thomas Thurman</title>
		<link>http://blogs.gnome.org/tthurman/2008/03/21/sscanf/comment-page-1/#comment-33</link>
		<dc:creator>Thomas Thurman</dc:creator>
		<pubDate>Fri, 21 Mar 2008 11:39:50 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/tthurman/2008/03/21/sscanf/#comment-33</guid>
		<description>Ah, I did spend a bit of time thinking about using the return value, but I hadn&#039;t thought of the idea of using the dummy variable.  Seems kind of obvious now you point it out :)  Thanks.</description>
		<content:encoded><![CDATA[<p>Ah, I did spend a bit of time thinking about using the return value, but I hadn&#8217;t thought of the idea of using the dummy variable.  Seems kind of obvious now you point it out :)  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benoît Dejean</title>
		<link>http://blogs.gnome.org/tthurman/2008/03/21/sscanf/comment-page-1/#comment-32</link>
		<dc:creator>Benoît Dejean</dc:creator>
		<pubDate>Fri, 21 Mar 2008 10:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/tthurman/2008/03/21/sscanf/#comment-32</guid>
		<description>Or you could just check sscanf return value ?</description>
		<content:encoded><![CDATA[<p>Or you could just check sscanf return value ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stef</title>
		<link>http://blogs.gnome.org/tthurman/2008/03/21/sscanf/comment-page-1/#comment-31</link>
		<dc:creator>Stef</dc:creator>
		<pubDate>Fri, 21 Mar 2008 09:32:52 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/tthurman/2008/03/21/sscanf/#comment-31</guid>
		<description>You could also use the fact that sscanf returns the number of fields successfully read.  Put a dummy %c at the end of the format and check that 
the result is equal to the number of % fields before it:

void
check(char *string)
{
  char dummy;
  int workspace ;

  int NB_FIELD=1 ;
  int nb = sscanf (string, &quot;Workspace %d%c&quot;, &amp;workspace, &amp;dummy);

  printf (&quot;Input is [%s],  fully=%s\n&quot;,
	  string, (nb==NB_FIELD) ? &quot;Yes&quot;:&quot;No&quot;);
}</description>
		<content:encoded><![CDATA[<p>You could also use the fact that sscanf returns the number of fields successfully read.  Put a dummy %c at the end of the format and check that<br />
the result is equal to the number of % fields before it:</p>
<p>void<br />
check(char *string)<br />
{<br />
  char dummy;<br />
  int workspace ;</p>
<p>  int NB_FIELD=1 ;<br />
  int nb = sscanf (string, &#8220;Workspace %d%c&#8221;, &amp;workspace, &amp;dummy);</p>
<p>  printf (&#8220;Input is [%s],  fully=%s\n&#8221;,<br />
	  string, (nb==NB_FIELD) ? &#8220;Yes&#8221;:&#8221;No&#8221;);<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  blogs.gnome.org/tthurman/2008/03/21/sscanf/feed/ ) in 0.14240 seconds, on Feb 11th, 2012 at 11:01 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 12th, 2012 at 12:01 am UTC -->
