summaryrefslogtreecommitdiff
path: root/ghc/lib/misc/cbits/PackedString.c
blob: 597fe30a3b88f31fca16f761d34d85b402b1af97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* -----------------------------------------------------------------------------
 * $Id: PackedString.c,v 1.2 1998/12/02 13:26:41 simonm Exp $
 *
 * PackedString C bits
 *
 * (c) The GHC Team 1998
 * -------------------------------------------------------------------------- */

#include "Rts.h"

StgInt
byteArrayHasNUL__ (StgByteArray ba, StgInt len)
{
    StgInt i;

    for (i = 0; i < len; i++) {
	if (*(ba + i) == '\0') {
	    return(1); /* true */
	}
    }

    return(0); /* false */
}