diff --git a/bseq.c b/bseq.c index e664c8f..d0a8fa9 100644 --- a/bseq.c +++ b/bseq.c @@ -39,7 +39,7 @@ mm_bseq_file_t *mm_bseq_open(const char *fn) { mm_bseq_file_t *fp; gzFile f; - f = fn && strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(fileno(stdin), "r"); + f = fn && strcmp(fn, "-")? gzopen(fn, "r") : gzdopen(0, "r"); if (f == 0) return 0; fp = (mm_bseq_file_t*)calloc(1, sizeof(mm_bseq_file_t)); fp->fp = f; diff --git a/format.c b/format.c index a7114c7..c5539f3 100644 --- a/format.c +++ b/format.c @@ -92,7 +92,8 @@ static void sam_write_rg_line(kstring_t *str, const char *s) if (mm_verbose >= 1) fprintf(stderr, "[ERROR] the read group line contained literal characters -- replace with escaped tabs: \\t\n"); goto err_set_rg; } - rg_line = strdup(s); + rg_line = (char*)malloc(strlen(s) + 1); + strcpy(rg_line, s); mm_escape(rg_line); if ((p = strstr(rg_line, "\tID:")) == 0) { if (mm_verbose >= 1) fprintf(stderr, "[ERROR] no ID within the read group line\n"); diff --git a/ksw2_dispatch.c b/ksw2_dispatch.c index c4e3e07..2d20d35 100644 --- a/ksw2_dispatch.c +++ b/ksw2_dispatch.c @@ -17,11 +17,11 @@ void __cpuidex(int cpuid[4], int func_id, int subfunc_id) { #if defined(__x86_64__) - asm volatile ("cpuid" + __asm__ volatile ("cpuid" : "=a" (cpuid[0]), "=b" (cpuid[1]), "=c" (cpuid[2]), "=d" (cpuid[3]) : "0" (func_id), "2" (subfunc_id)); #else // on 32bit, ebx can NOT be used as PIC code - asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" + __asm__ volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" : "=a" (cpuid[0]), "=r" (cpuid[1]), "=c" (cpuid[2]), "=d" (cpuid[3]) : "0" (func_id), "2" (subfunc_id)); #endif diff --git a/main.c b/main.c index d5e0307..00caaec 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ #include "mmpriv.h" #include "ketopt.h" -#define MM_VERSION "2.13-r866-dirty" +#define MM_VERSION "2.13-r873-dirty" #ifdef __linux__ #include diff --git a/misc.c b/misc.c index 930e6bf..f6b8c5f 100644 --- a/misc.c +++ b/misc.c @@ -116,8 +116,7 @@ long peakrss(void) double realtime(void) { struct timeval tp; - struct timezone tzp; - gettimeofday(&tp, &tzp); + gettimeofday(&tp, NULL); return tp.tv_sec + tp.tv_usec * 1e-6; }