# HG changeset patch # User pyon@macmini # Date 1508840976 -32400 # Node ID edfa39292d78a3fb97e0872cd2560dda3521db67 # Parent f96c40f7aeae19d8e4c82b6eed21329a973bda94 small fix. diff -r f96c40f7aeae -r edfa39292d78 xdwgrep2.cpp --- a/xdwgrep2.cpp Mon Oct 23 20:15:22 2017 +0900 +++ b/xdwgrep2.cpp Tue Oct 24 19:29:36 2017 +0900 @@ -139,7 +139,7 @@ unmatch = 1; break; default: - printf("error: illegal option '%c'.\n", c ); + fprintf( stderr, "error: illegal option '%c'.\n", c ); exit( 1 ); } } diff -r f96c40f7aeae -r edfa39292d78 xdwsort.cpp --- a/xdwsort.cpp Mon Oct 23 20:15:22 2017 +0900 +++ b/xdwsort.cpp Tue Oct 24 19:29:36 2017 +0900 @@ -1,14 +1,14 @@ /* Makefile -debug: xdwsort.cpp +debug: xdwsort.c #rm -rf tempXXXX #cls - gcc -g -O0 -I. xdwsort.cpp xdwapi.lib + gcc -g -O0 -I. xdwsort.c xdwapi.lib #date #./a.exe target.xdw #date -release: xdwsort.cpp - gcc -I. xdwsort.cpp xdwapi.lib -static -o xdwsort.exe +release: xdwsort.c + gcc -I. xdwsort.c xdwapi.lib -static -o xdwsort.exe strip xdwsort.exe clean: @@ -84,7 +84,7 @@ case 'l': /* now writing... */ break; default: - printf("error: illegal option '%c'.\n", c ); + fprintf( stderr, "error: illegal option '%c'.\n", c ); exit( 1 ); } } @@ -220,7 +220,7 @@ } sprintf( buf, "tempXXXX/%04d.xdw", p + 1 ); _fullpath( in_path, buf, _MAX_PATH ); - strncpy( &blk_path[ m * _MAX_PATH ], buf, _MAX_PATH ); + strncpy( &blk_path[ m * _MAX_PATH ], in_path, _MAX_PATH ); blk_path_addr[m] = &blk_path[ m * _MAX_PATH ]; } if ( last_page % BLOCKSZ != 0 ) { @@ -237,7 +237,7 @@ for ( int b = 0; b < bn; b++ ) { sprintf( buf, "tempXXXX/b%04d.xdw", b + 1 ); _fullpath( in_path, buf, _MAX_PATH ); - strncpy( &blk_path[ b * _MAX_PATH ], buf, _MAX_PATH ); + strncpy( &blk_path[ b * _MAX_PATH ], in_path, _MAX_PATH ); blk_path_addr[b] = &blk_path[ b * _MAX_PATH ]; } _fullpath( in_path, "tempXXXX/temp.xdw", _MAX_PATH );