octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #34183] 'save' inside function fills 'argn' wi


From: Andreas Weber
Subject: [Octave-bug-tracker] [bug #34183] 'save' inside function fills 'argn' with binary 0
Date: Wed, 31 Aug 2011 16:57:29 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 Iceweasel/5.0

URL:
  <http://savannah.gnu.org/bugs/?34183>

                 Summary: 'save' inside function fills 'argn' with binary 0
                 Project: GNU Octave
            Submitted by: andy1978
            Submitted on: Mi 31 Aug 2011 16:57:23 GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

hg id
b646413c3d0e+ tip

A call of 'save' without arguments even saves the automatic generated var
'argn'. 
The problem with this is: If there is a string parameter present, the
remaining space is filled with binary zeros (see hd output at the end) and
some text editors (for ex. gedit) doesn't open the file.


function ret=myfunction(a,b,c)
  save mylog.log
endfunction
 
myfunction(pi,"hi octave",5)


=== cat output===

$ cat mylog.log 
# Created by Octave 3.5.0+, Wed Aug 31 18:31:08 2011 CEST <address@hidden>
# name: a
# type: scalar
3.141592653589793


# name: argn
# type: sq_string
# elements: 3
# length: 11
pi
# length: 11
"hi octave"
# length: 11
5


# name: b
# type: string
# elements: 1
# length: 9
hi octave


# name: c
# type: scalar
5


=== hd output ===

$ hd mylog.log 
00000000  23 20 43 72 65 61 74 65  64 20 62 79 20 4f 63 74  |# Created by
Oct|
00000010  61 76 65 20 33 2e 35 2e  30 2b 2c 20 57 65 64 20  |ave 3.5.0+, Wed
|
00000020  41 75 67 20 33 31 20 31  38 3a 33 31 3a 30 38 20  |Aug 31 18:31:08
|
00000030  32 30 31 31 20 43 45 53  54 20 3c 61 6e 64 79 40  |2011 CEST
<andy@|
00000040  50 68 65 6e 6f 6d 42 61  62 65 3e 0a 23 20 6e 61  |PhenomBabe>.#
na|
00000050  6d 65 3a 20 61 0a 23 20  74 79 70 65 3a 20 73 63  |me: a.# type:
sc|
00000060  61 6c 61 72 0a 33 2e 31  34 31 35 39 32 36 35 33 
|alar.3.141592653|
00000070  35 38 39 37 39 33 0a 0a  0a 23 20 6e 61 6d 65 3a  |589793...#
name:|
00000080  20 61 72 67 6e 0a 23 20  74 79 70 65 3a 20 73 71  | argn.# type:
sq|
00000090  5f 73 74 72 69 6e 67 0a  23 20 65 6c 65 6d 65 6e  |_string.#
elemen|
000000a0  74 73 3a 20 33 0a 23 20  6c 65 6e 67 74 68 3a 20  |ts: 3.# length:
|
000000b0  31 31 0a 70 69 00 00 00  00 00 00 00 00 00 0a 23 
|11.pi..........#|
000000c0  20 6c 65 6e 67 74 68 3a  20 31 31 0a 22 68 69 20  | length: 11."hi
|
000000d0  6f 63 74 61 76 65 22 0a  23 20 6c 65 6e 67 74 68  |octave".#
length|
000000e0  3a 20 31 31 0a 35 00 00  00 00 00 00 00 00 00 00  |:
11.5..........|
000000f0  0a 0a 0a 23 20 6e 61 6d  65 3a 20 62 0a 23 20 74  |...# name: b.#
t|
00000100  79 70 65 3a 20 73 74 72  69 6e 67 0a 23 20 65 6c  |ype: string.#
el|
00000110  65 6d 65 6e 74 73 3a 20  31 0a 23 20 6c 65 6e 67  |ements: 1.#
leng|
00000120  74 68 3a 20 39 0a 68 69  20 6f 63 74 61 76 65 0a  |th: 9.hi
octave.|
00000130  0a 0a 23 20 6e 61 6d 65  3a 20 63 0a 23 20 74 79  |..# name: c.#
ty|
00000140  70 65 3a 20 73 63 61 6c  61 72 0a 35 0a 0a 0a     |pe: scalar.5...|
0000014f







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?34183>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]