f952b14fca3833e9d8fef0ae8a086ad15485b552 galt Wed Jan 1 02:11:38 2025 -0800 fix various errors for utils compiled on Rocky 9 hgwdev-new. diff --git src/hg/autoXml/autoXml.c src/hg/autoXml/autoXml.c index 5123f23..616e575 100644 --- src/hg/autoXml/autoXml.c +++ src/hg/autoXml/autoXml.c @@ -3,31 +3,31 @@ #include "linefile.h" #include "hash.h" #include "dystring.h" #include "cheapcgi.h" #include "obscure.h" #include "portable.h" #include "dtdParse.h" /* Variables that can be over-ridden from command line. */ char *textField = "text"; char *fileComment = "autoXml generated file"; boolean picky; /* Generate a parser that is afraid of the unknown. */ boolean makeMain; /* Generate main() routine as test shell. */ boolean positiveOnly; /* Don't write out negative numbers. */ -char prefix[128]; /* Added to start of output file and structure names. */ +char prefix[FILENAME_LEN]; /* Added to start of output file and structure names. */ void usage() /* Explain usage and exit. */ { errAbort( "autoXml - Generate structures code and parser for XML file from DTD-like spec\n" "usage:\n" " autoXml file.dtdx root\n" "This will generate root.c, root.h\n" "options:\n" " -textField=xxx what to name text between start/end tags. Default 'text'\n" " -comment=xxx Comment to appear at top of generated code files\n" " -picky Generate parser that rejects stuff it doesn't understand\n" " -main Put in a main routine that's a test harness\n" " -prefix=xxx Prefix to add to structure names. By default same as root\n" @@ -680,31 +680,31 @@ loadNextFunctionPrototype(el, f, ""); loadNextFunctionBody(el, f); } makeStartHandler(elList, f); makeEndHandler(elList, f); if (makeMain) makeTestDriver(elList, f); } void autoXml(char *dtdxFile, char *outRoot) /* autoXml - Generate structures code and parser for XML file from DTD-like spec. */ { struct dtdElement *elList = NULL; struct hash *elHash = NULL; char hName[512], cName[512]; -char outDir[256]; +char outDir[PATH_LEN]; splitPath(outRoot, outDir, prefix, NULL); if (cgiVarExists("prefix")) strcpy(prefix, cgiString("prefix")); if (outDir[0] != 0) makeDir(outDir); dtdParse(dtdxFile, prefix, textField, &elList, &elHash); printf("Parsed %d elements in %s\n", slCount(elList), dtdxFile); sprintf(hName, "%s.h", outRoot); makeH(elList, hName); sprintf(cName, "%s.c", outRoot); makeC(elList, cName, hName); printf("Generated code in %s\n", cName); }