From edd45b2d961876fe2105a1a27fa53b7c2044ed5b Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Sun, 15 Sep 2013 02:57:12 +0200 Subject: type for counter changed to not overflow before loop conditional is reached --- samples/X11/x11atomstuffer/x11atomstuffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/X11/x11atomstuffer/x11atomstuffer.c b/samples/X11/x11atomstuffer/x11atomstuffer.c index d2f338f..70ed425 100644 --- a/samples/X11/x11atomstuffer/x11atomstuffer.c +++ b/samples/X11/x11atomstuffer/x11atomstuffer.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -29,7 +30,8 @@ char const doitkey[] = "wastemyX11server"; int main(int argc, char *argv[]) { - unsigned int i; + uint64_t i; + unsigned int r = getpid() ^ time(NULL); if( argc < 2 || strcmp(argv[1], doitkey) ) { fprintf(stderr, @@ -57,11 +59,9 @@ int main(int argc, char *argv[]) } Xscreen = DefaultScreen(Xdisplay); - unsigned int r = getpid() ^ time(NULL); - for(i=0; i < 0xffffffff; i++) { char atomstr[33]; - snprintf(atomstr,32, "_wasted_0x%08x_0x%08x", r, i); + snprintf(atomstr,32, "_wasted_0x%08x_0x%08x", r, (unsigned int)i); XInternAtom(Xdisplay, atomstr, False); if( !(i % 0x00010000 ) ) { fprintf(stderr, "%s\n", atomstr); -- cgit v1.2.3