Skip to content

Commit 2ca67f1

Browse files
committed
Fix writing string with less characters than before
1 parent 8edaa4b commit 2ca67f1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typed-buffer-struct",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "This is a package which helps the user to create a Struct with automatic Buffer creation.",
55
"author": {
66
"name": "Nelson Faiçal Rechdan",
@@ -18,12 +18,12 @@
1818
"pub:alpha": "clear && yarn run build && npm publish --tag alpha --access public"
1919
},
2020
"devDependencies": {
21-
"@types/node": "16.11.6",
22-
"@typescript-eslint/eslint-plugin": "5.3.2-alpha.0",
23-
"@typescript-eslint/parser": "5.3.2-alpha.0",
24-
"eslint": "8.2.0",
21+
"@types/node": "16.11.9",
22+
"@typescript-eslint/eslint-plugin": "5.4.1-alpha.18",
23+
"@typescript-eslint/parser": "5.4.1-alpha.18",
24+
"eslint": "8.3.0",
2525
"ttypescript": "1.5.12",
26-
"typescript": "4.4.4",
26+
"typescript": "4.5.2",
2727
"typescript-transform-paths": "3.3.1"
2828
},
2929
"files": [

src/struct/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ export const readStringBuffer: ReadStringBuffer = (buffer, offset, length) => {
6565
};
6666

6767
export const writeStringBuffer: WriteStringBuffer = (buffer, offset, length, value) => {
68-
buffer.write(value, offset, offset + length, "latin1");
68+
buffer.fill(0, offset, offset + length, "latin1").write(value, offset, offset + length, "latin1");
6969
};

0 commit comments

Comments
 (0)