| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -541,15 +541,16 @@ dump_ascii(int fd, PyObject *text) | |||
| 541 | 541 | ch = PyUnicode_READ(kind, data, i); | |
| 542 | 542 | else | |
| 543 | 543 | ch = wstr[i]; | |
| 544 | - if (ch < 128) { | ||
| 544 | + if (' ' <= ch && ch <= 126) { | ||
| 545 | + /* printable ASCII character */ | ||
| 545 | 546 | char c = (char)ch; | |
| 546 | 547 | write(fd, &c, 1); | |
| 547 | 548 | } | |
| 548 | - else if (ch < 0xff) { | ||
| 549 | + else if (ch <= 0xff) { | ||
| 549 | 550 | PUTS(fd, "\\x"); | |
| 550 | 551 | dump_hexadecimal(fd, ch, 2); | |
| 551 | 552 | } | |
| 552 | - else if (ch < 0xffff) { | ||
| 553 | + else if (ch <= 0xffff) { | ||
| 553 | 554 | PUTS(fd, "\\u"); | |
| 554 | 555 | dump_hexadecimal(fd, ch, 4); | |
| 555 | 556 | } | |
@@ -644,7 +645,7 @@ write_thread_id(int fd, PyThreadState *tstate, int is_current) | |||
| 644 | 645 | PUTS(fd, "Current thread 0x"); | |
| 645 | 646 | else | |
| 646 | 647 | PUTS(fd, "Thread 0x"); | |
| 647 | - dump_hexadecimal(fd, (unsigned long)tstate->thread_id, sizeof(long)*2); | ||
| 648 | + dump_hexadecimal(fd, (unsigned long)tstate->thread_id, sizeof(unsigned long)*2); | ||
| 648 | 649 | PUTS(fd, " (most recent call first):\n"); | |
| 649 | 650 | } | |
| 650 | 651 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments