Modify ↓
Opened 16 years ago
Closed 16 years ago
#1684 closed Bug (Fixed)
FileRead: negative "count" value in binary mode causes "Error allocating memory"
| Reported by: | ChiDragon | Owned by: | J-Paul Mesnage |
|---|---|---|---|
| Milestone: | 3.3.7.0 | Component: | AutoIt |
| Version: | 3.3.6.1 | Severity: | None |
| Keywords: | FileRead binary Error allocating memory | Cc: |
Description
Au3Check does not throw any error. The memory allocation error simply pops up when the script is executed.
The Help file gives no indication of what acceptable values of "count" may be, or how to force reading the whole file when "count" is specified. Negative values in text-mode do in fact cause the entire file to be read.
Sufficient to reproduce:
$Handle = FileOpen (@ScriptFullPath, 16) $WholeFile = FileRead ($Handle, -1) FileClose ($Handle)
As mentioned, no problems if "0" is used instead of "16" to read in text-mode. The whole file is simply read just the same as if "count" was never specified.
$Handle = FileOpen (@ScriptFullPath, 0) $WholeFile = FileRead ($Handle, -1) FileClose ($Handle) MsgBox (0, "", $WholeFile)
Attachments (0)
Change History (1)
comment:1 by , 16 years ago
| Milestone: | → 3.3.7.0 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

Fixed by revision [5886] in version: 3.3.7.0