1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2009 Index Data
3 * See the file LICENSE for details.
12 #include <yaz/xmalloc.h>
19 p = (char *) xmalloc(10);
21 p = (char *) xrealloc(p, 20);
29 YAZ_CHECK(!strcmp(p, "hello"));
32 p = xstrndup("hello", 2);
36 YAZ_CHECK(!strcmp(p, "he"));
39 p = xstrndup("hello", 6);
43 YAZ_CHECK(!strcmp(p, "hello"));
47 int main (int argc, char **argv)
49 YAZ_CHECK_INIT(argc, argv);
56 * c-file-style: "Stroustrup"
57 * indent-tabs-mode: nil
59 * vim: shiftwidth=4 tabstop=8 expandtab