diff --git a/sys/src/cmd/ndb/dblookup.c b/sys/src/cmd/ndb/dblookup.c index 0d5458778..432abc48e 100644 --- a/sys/src/cmd/ndb/dblookup.c +++ b/sys/src/cmd/ndb/dblookup.c @@ -459,10 +459,10 @@ txtrr(Ndbtuple*, Ndbtuple *pair) for(i = 0; i < n && sofar < len; i++){ uint c = pair->val[sofar++]; if(c == '\\' && sofar < len){ - if(pair->val[sofar] >= '0' && pair->val[sofar] <= '7'){ + if(pair->val[sofar] >= '0' && pair->val[sofar] <= '9'){ c = pair->val[sofar++] - '0'; - while(pair->val[sofar] >= '0' && pair->val[sofar] <= '7') - c = (c << 3) | (pair->val[sofar++] - '0'); + while(pair->val[sofar] >= '0' && pair->val[sofar] <= '9') + c = (c * 10) + (pair->val[sofar++] - '0'); } else { c = pair->val[sofar++]; } diff --git a/sys/src/cmd/ndb/dn.c b/sys/src/cmd/ndb/dn.c index 377fdd987..2fbbb50c6 100644 --- a/sys/src/cmd/ndb/dn.c +++ b/sys/src/cmd/ndb/dn.c @@ -1201,7 +1201,7 @@ idnname(DN *dn, char *buf, int nbuf) * control characters and double quotes (") which would * collide with ndb(6) format. * escape special characters by encoding them as: \DDD - * where D is a octal digit. backslash (\) is escaped + * where D is a decimal digit. backslash (\) is escaped * by doubling. valid utf8 is encoded verbatim. */ int @@ -1227,7 +1227,7 @@ bslashfmt(Fmt *f) } c = *data; if(c < ' ' || c == '"' || c > '~') - out += fmtprint(f, "\\%.3o", c); + out += fmtprint(f, "\\%.3d", c); else if(c == '\\') out += fmtprint(f, "\\\\"); else