#include <ncbi.h>
#include <gishlib.h>

int LIBCALL
str_nprefix(s, pref, n)
	CharPtr	s, pref;
	register size_t	n;
{
	register BytePtr us = (BytePtr)s, upref = (BytePtr)pref;
	register Byte	ch;

	while (n-- > 0 && (ch = *upref++) == *us++)
		if (ch == NULLB)
			return 0;
	if (n == 0 || ch == NULLB)
		return 0;
	return (int)ch - (int)*--us;
}
