forked from Lainports/freebsd-ports
o Some fix (NULL != NUL, void main -> int main). o Update archive md5. some bug fix in new archive(this was released after 19 hours than old one). Submitted by: Yoshihiko - he is in seat next mine in jammed Chuou Highway - Sarumaru <mistral@imasy.or.jp> (maintainer) Committed at: jammed Chuou Highway in Japan
42 lines
986 B
Text
42 lines
986 B
Text
--- nodeop.c.orig Wed Mar 16 13:10:45 1994
|
|
+++ nodeop.c Sun Mar 21 17:44:55 2004
|
|
@@ -142,7 +142,8 @@ int depth;
|
|
|
|
/* for each child */
|
|
for(np = nodep->child; NODE_NULL != np; np = np->peer){
|
|
- double height = h * np->size / nodep->size;
|
|
+ /* When nodep->size is 0, 'divided by zero' will be raised */
|
|
+ double height = (nodep->size != 0 ? h * np->size / nodep->size : 0);
|
|
|
|
drawrect(np, y, height, depth);
|
|
|
|
@@ -172,9 +173,9 @@ parse()
|
|
if('/' == *n) n++; /* skip leading / */
|
|
path[depth = 0] = n;
|
|
|
|
- for(; NULL != *n; n++){
|
|
+ for(; '\0' != *n; n++){
|
|
if('/' == *n){
|
|
- *n = NULL;
|
|
+ *n = '\0';
|
|
path[++depth] = n + 1;
|
|
if(depth > MAXDEPTH) break;
|
|
}
|
|
@@ -193,7 +194,7 @@ parse()
|
|
|
|
if (1 == top->nchild) {
|
|
top = top->child;
|
|
- while (NULL != *n) n++;
|
|
+ while ('\0' != *n) n++;
|
|
*n = '/';
|
|
}
|
|
else if(1 < top->nchild){
|
|
@@ -204,7 +205,7 @@ parse()
|
|
}
|
|
else break;
|
|
}
|
|
- *n = NULL;
|
|
+ *n = '\0';
|
|
return strdup(name);
|
|
}
|
|
|