Skip to content

Commit

Permalink
fixed setfault bom-test when make check
Browse files Browse the repository at this point in the history
- add missing test sample files
  • Loading branch information
Joungkyun committed May 13, 2021
1 parent acf4e8f commit 0ff2649
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

DISTCLEANFILES =
EXTRA_DIST = Changelog LICENSE libchardet.spec \
project/libchardet.cbp
project/libchardet.cbp test/utf-8.txt test/utf-8-bom.txt

ACLOCAL_AMFLAGS = -I m4
SUBDIRS = . src man test
Expand Down
2 changes: 1 addition & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
DISTCLEANFILES = *.bz2 aclocal.m4 *~
EXTRA_DIST = Changelog LICENSE libchardet.spec \
project/libchardet.cbp
project/libchardet.cbp test/utf-8.txt test/utf-8-bom.txt

ACLOCAL_AMFLAGS = -I m4
SUBDIRS = . src man test
Expand Down
5 changes: 4 additions & 1 deletion test/bom-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ int main (int argc, char **argv) {
char *f[2] = { "utf-8-bom.txt", "utf-8.txt" };

for ( i=0; i<2; i++ ) {
stat (f[i], &sb);
if ( stat (f[i], &sb) != 0 ) {
fprintf (stderr, "file %s not found.", f[i]);
continue;
}

buf = malloc (sizeof (char) * (sb.st_size + 4));
memset (buf, 0, sb.st_size + 4);
Expand Down

0 comments on commit 0ff2649

Please sign in to comment.