# Int display problem

**URL:** <https://forums.digi.com/t/int-display-problem/10127>\
**Category:** Rabbit\
**Created:** [July 21, 2008, 8:53pm UTC](https://forums.digi.com/t/int-display-problem/10127 "2008-07-21T20:53:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![busketjoe](https://avatars.discourse-cdn.com/v4/letter/b/c0e974/32.png) [@busketjoe](https://forums.digi.com/u/busketjoe)\
**Post date:** [July 21, 2008, 8:53pm UTC](https://forums.digi.com/t/int-display-problem/10127/1 "2008-07-21T20:53:16Z")

</div>

I’m having a bit of trouble displaying some data. Frankly, the problem seems a bit confound, which probably means that the solution is really elementary and I’ve succeeded in completely overlooking it.

Here it is:

The following code is supposed to display info stored in xmem, and it does, for the most part. The problem is that when it goes to display samp (an unsigned integer) a seemingly random number displays before samp.

If samp = 1, the number that gets displayed is something like “51” or “111” or “61”.  
If samp = 47, the number that gets displayed is something like “147” or “647”, etc.

This didn’t make sense to me, so I added the

```auto
sprintf(outstr,"sample size: %u
", samp);
                           serBputs(outstr);

```

which displays samp correctly.

```auto

if (chr==13 &amp;&amp; pccount == 6 &amp;&amp; strncmp(pcchar, "infob", 5) ==0)
               {
                     xmem2root(&amp;headcount,add_header,2); //get # of blocks

                     if(headcount==0)
                      	textout("There are no blocks currently indexed.
");

                     if(headcount&gt;0)
                     {
                     	sprintf(outstr,"Block #,START:month,day,year,hour,min,sec,channels,stat,n,sample
");
                     	serBputs(outstr);

                        for(tmpuint=0;tmpuint
```

---

<div class="post-metadata">

**Author:** ![busketjoe](https://avatars.discourse-cdn.com/v4/letter/b/c0e974/32.png) [@busketjoe](https://forums.digi.com/u/busketjoe)\
**Post date:** [August 6, 2008, 9:31pm UTC](https://forums.digi.com/t/int-display-problem/10127/2 "2008-08-06T21:31:33Z")

</div>

I figured it out. All I had to do was place the entire offending sprintf call on one line, which, of course, makes perfect sense.
