From 109c58ef682799fc7e92d7a74a9c3073f1ccd0ec Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Wed, 18 Jan 2017 13:03:48 +0100 Subject: prog: mutate sized strings with respect to size --- sysgen/sysgen.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysgen') diff --git a/sysgen/sysgen.go b/sysgen/sysgen.go index ecc237118..c71936c01 100644 --- a/sysgen/sysgen.go +++ b/sysgen/sysgen.go @@ -433,8 +433,8 @@ func generateArg( for i, s := range vals { vals[i] = s + "\x00" } + var size uint64 if len(a) >= 2 { - var size uint64 if v, ok := consts[a[1]]; ok { size = v } else { @@ -454,7 +454,7 @@ func generateArg( vals[i] = s } } - fmt.Fprintf(out, "&BufferType{%v, Kind: BufferString, SubKind: %q, Values: %#v}", common(), subkind, vals) + fmt.Fprintf(out, "&BufferType{%v, Kind: BufferString, SubKind: %q, Values: %#v, Length: %v}", common(), subkind, vals, size) case "salg_type": if want := 0; len(a) != want { failf("wrong number of arguments for %v arg %v, want %v, got %v", typ, name, want, len(a)) -- cgit mrf-deployment