File tree 5 files changed +9
-9
lines changed
5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func doit(w io.Writer, fSys *afero.Afero) {
32
32
if len (os .Args ) != 1 {
33
33
fmt .Fprintln (w , version , commit , date )
34
34
fmt .Fprintln (w , "Feed with a space separated byte sequence to decode a TCOBSv1 sequence." )
35
- fmt .Fprintln (w , "Example: `echo 64 1 2 18 88 25 88 161 | TCOBSv1Decode ` will return `0 0 1 2 2 2 2 88 88 88 88 88 88`" )
35
+ fmt .Fprintln (w , "Example: `echo 64 1 2 18 88 25 88 161 | TCOBSv1CDecode ` will return `0 0 1 2 2 2 2 88 88 88 88 88 88`" )
36
36
return
37
37
}
38
38
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func doit(w io.Writer, fSys *afero.Afero) {
32
32
if len (os .Args ) != 1 {
33
33
fmt .Fprintln (w , version , commit , date )
34
34
fmt .Fprintln (w , "Feed with a space separated byte sequence to encode it in a TCOBSv1 sequence." )
35
- fmt .Fprintln (w , "Example: `echo 0 0 1 0b10 2 02 0x2 88 88 88 88 88 88 | TCOBSv1Encode ` will return `64 1 2 18 88 25 88 161`" )
35
+ fmt .Fprintln (w , "Example: `echo 0 0 1 0b10 2 02 0x2 88 88 88 88 88 88 | TCOBSv1CEncode ` will return `64 1 2 18 88 25 88 161`" )
36
36
return
37
37
}
38
38
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func doit(w io.Writer, fSys *afero.Afero) {
32
32
if len (os .Args ) != 1 {
33
33
fmt .Fprintln (w , version , commit , date )
34
34
fmt .Fprintln (w , "Feed with a space separated byte sequence to decode a TCOBSv2 sequence." )
35
- fmt .Fprintln (w , "Example: `echo 96 1 2 66 88 129 128 | TCOBSv2Decode ` will return `0 0 1 2 2 2 2 88 88 88 88 88 88`" )
35
+ fmt .Fprintln (w , "Example: `echo 96 1 2 66 88 129 128 | TCOBSv2CDecode ` will return `0 0 1 2 2 2 2 88 88 88 88 88 88`" )
36
36
return
37
37
}
38
38
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func doit(w io.Writer, fSys *afero.Afero) {
32
32
if len (os .Args ) != 1 {
33
33
fmt .Fprintln (w , version , commit , date )
34
34
fmt .Fprintln (w , "Feed with a space separated byte sequence to encode it in a TCOBSv2 sequence." )
35
- fmt .Fprintln (w , "Example: `echo 0 0 1 0b10 2 02 0x2 88 88 88 88 88 88 | TCOBSv2Encode ` will return `96 1 2 66 88 129 128`" )
35
+ fmt .Fprintln (w , "Example: `echo 0 0 1 0b10 2 02 0x2 88 88 88 88 88 88 | TCOBSv2CEncode ` will return `96 1 2 66 88 129 128`" )
36
36
return
37
37
}
38
38
Original file line number Diff line number Diff line change @@ -10,16 +10,16 @@ import (
10
10
11
11
// todo: -flto switch does not work on some Windows (Antivirus?) setups.
12
12
13
- // CEncode encodes `i` into `o` and returns number of bytes in `o` .
13
+ // CEncode encodes `i` into `o` and returns number of bytes.
14
14
// For details see https://github.com/rokath/TCOBS/blob/master/docs/TCOBSSpecification.md.
15
15
// The CEncode implementation is done in C because the aimed use case is an embedded device running C.
16
16
// This function is mainly for testing.
17
- func CEncode (o , i []byte ) ( n int ) {
17
+ func CEncode (o , i []byte ) int {
18
18
if len (i ) == 0 {
19
- return
19
+ return 0
20
20
}
21
21
in := unsafe .Pointer (& i [0 ])
22
22
out := unsafe .Pointer (& o [0 ])
23
- n = int (C .TCOBSEncode (out , in , C .size_t (len (i ))))
24
- return
23
+ n : = int (C .TCOBSEncode (out , in , C .size_t (len (i ))))
24
+ return n
25
25
}
You can’t perform that action at this time.
0 commit comments