Permalink
Browse files

Merge pull request #2 from wandai330/int-type-overflow

Some int type variable overflow
  • Loading branch information...
2 parents dac8de5 + dabfc9c commit 14d6c8d78f6e95a6ef8ed2365a9a5ad3e8cafb86 @wandai330 wandai330 committed on GitHub Jun 20, 2017
Showing with 4 additions and 5 deletions.
  1. +3 −3 clipper/fastq-multx.cpp
  2. +1 −2 clipper/fastq-stats.cpp
View
@@ -25,7 +25,7 @@ THE SOFTWARE.
See "void usage" below for usage.
*/
-#include <cinttypes>
+
#include "fastq-lib.h"
#define MAX_BARCODE_NUM 6000
@@ -1074,15 +1074,15 @@ int main (int argc, char **argv) {
printf("Id\tCount\tFile(s)\n");
uint64_t tot=0;
for (i=0;i<=bcnt;++i) {
- printf("%s\t%" PRIu64, bc[i].id.s, bc[i].cnt);
+ printf("%s\t%lu", bc[i].id.s, bc[i].cnt);
tot+=bc[i].cnt;
for (j=0;j<f_n;++j) {
if (bc[i].out[j])
printf("\t%s", bc[i].out[j]);
}
printf("\n");
}
- printf("total\t%" PRIu64 "\n", tot);
+ printf("total\t%lu\n", tot);
if (!io_ok)
return 3;
View
@@ -25,7 +25,6 @@ const char * VERSION = "1.01 $Id$";
#include <ctype.h>
#include <stdio.h>
-#include <cinttypes>
void usage( FILE * f ) {
fprintf( f,
@@ -567,7 +566,7 @@ int main( int argc, char**argv ) {
if(gc) {
// put these where they belong
if (debug)
- printf("gcTotal\t%" PRIu64 "\tgcSum\t%f\n\n", gcTotal, gcSum);
+ printf("gcTotal\t%lu\tgcSum\t%f\n\n", gcTotal, gcSum);
printf("pct-gc cycle-max\t%d\n", gcCyclemax);
printf("pct-gc mean\t%.2f\n", 100.0 * gcSum / gcTotal);
}

0 comments on commit 14d6c8d

Please sign in to comment.