efb9ff6af961b346f635ceeddda7719da044ba68 galt Mon Mar 7 11:38:33 2011 -0800 minor change to bigWarnNumLines() to use an existing lib function diff --git src/hg/hgTracks/bigWarn.c src/hg/hgTracks/bigWarn.c index b11079e..d4bdf82 100644 --- src/hg/hgTracks/bigWarn.c +++ src/hg/hgTracks/bigWarn.c @@ -1,33 +1,27 @@ /* bigWarn -- shared handlers for displaying big/udc warn/error messages */ #include "common.h" #include "hgTracks.h" #include "container.h" #include "bigWarn.h" static int bigWarnNumLines(char *errMsg) /* Count number of lines in err msg */ { -int n = 0; -char *nl = errMsg; +int n = countChars(errMsg, '\n'); int sl = strlen(errMsg); -while ((nl = strchr(nl,'\n'))) - { - ++n; - ++nl; - } if ((sl > 0) && (errMsg[sl-1]!='\n')) ++n; return n; } char *bigWarnReformat(char *errMsg) /* Return a copy of the re-formatted error message, * such as breaking longer lines */ { /* convert ". " to ".\n" to break long lines. */ char *result = cloneString(errMsg); char *nl = result; while ((nl = strchr(nl,'.'))) {