OSDN Git Service
(root)
/
hengbandforosx
/
hengbandosx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cea6327
)
In angband_fgets() replace nonprintables with '?' rather than strip them. Without...
author
Eric Branlund
<ebranlund@fastmail.com>
Fri, 14 May 2021 21:57:22 +0000
(14:57 -0700)
committer
Eric Branlund
<ebranlund@fastmail.com>
Fri, 14 May 2021 21:57:22 +0000
(14:57 -0700)
src/util/angband-files.cpp
patch
|
blob
|
history
diff --git
a/src/util/angband-files.cpp
b/src/util/angband-files.cpp
index
8cebec3
..
cc4409f
100644
(file)
--- a/
src/util/angband-files.cpp
+++ b/
src/util/angband-files.cpp
@@
-236,7
+236,7
@@
FILE *angband_fopen_temp(char *buf, int max)
*
* Read a string, without a newline, to a file
*
- * Process tabs,
strip internal non-printables
+ * Process tabs,
replace internal non-printables with '?'
*/
errr angband_fgets(FILE *fff, char *buf, huge n)
{
@@
-283,6
+283,10
@@
errr angband_fgets(FILE *fff, char *buf, huge n)
buf[i++] = *s;
if (i >= n)
break;
+ } else {
+ buf[i++] = '?';
+ if (i >= n)
+ break;
}
}