diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2022-02-17 21:02:53 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2022-02-17 21:02:53 +0200 |
commit | d159e3d81953551bddd929f6a7b9e083198dd933 (patch) | |
tree | bf47d371e40c4ae327f1833108dc53353f2da8ec | |
parent | 6de35853113a2a4a8eab661c569fe0d9171eb13a (diff) | |
download | gdbm-d159e3d81953551bddd929f6a7b9e083198dd933.tar.gz |
Fix octal output in gdbm shell
* tools/datconv.c (f_string): Fix printing bytes in octal.
-rw-r--r-- | tools/datconv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/datconv.c b/tools/datconv.c index 874e260..dbe4097 100644 --- a/tools/datconv.c +++ b/tools/datconv.c @@ -81,7 +81,7 @@ f_string (FILE *fp, void *ptr, int size) int n = mbtowc (&wc, &str[i], MB_CUR_MAX); if (n == 0) { - fprintf (fp, "\\%03o", *(unsigned char*)str); + fprintf (fp, "\\%03o", *(unsigned char*)(str+i)); i++; } else if (n == -1 || !iswprint (wc)) |