[Libreoffice-bugs] [Bug 143974] New: Basic function CStr is failing to properly convert integers after 41 steps in a for loop

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Aug 20 12:17:25 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=143974

            Bug ID: 143974
           Summary: Basic function CStr is failing to properly convert
                    integers after 41 steps in a for loop
           Product: LibreOffice
           Version: 7.3.0.0 alpha0+ Master
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: j.ragan at ms.pl

Created attachment 174445
  --> https://bugs.documentfoundation.org/attachment.cgi?id=174445&action=edit
MsgBox screenshot with result.

While testing one of my macros I have discovered a bug.
If you run the following macro:

Sub Main
Dim Txt As String
    For i = 1 To 50
        Txt = Txt + CStr(i)
        If (i mod 10 = 0) Then
            Txt = Txt + CHR(10)
        Else
            Txt = Txt + ", "
        End If
    Next i
    MsgBox Txt
End Sub

You will notice, that values 42, 44, 47, 49 have been extended with lots of
zeros and one at the end.

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 1b06e7e9e8c467de3450077fe8b90be6b7f73e4b
CPU threads: 2; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: pl-PL (pl_PL.UTF-8); UI: en-US
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210820/ec06b4bc/attachment.htm>


More information about the Libreoffice-bugs mailing list