Skip to content

Fixes #432 (read syscall length is halved for stdin)#433

Open
iridescent1024 wants to merge 1 commit intomortbopet:masterfrom
iridescent1024:fix-read-syscall-stdin
Open

Fixes #432 (read syscall length is halved for stdin)#433
iridescent1024 wants to merge 1 commit intomortbopet:masterfrom
iridescent1024:fix-read-syscall-stdin

Conversation

@iridescent1024
Copy link

Summary

This PR fixes a bug where read syscalls on stdin process only half the buffer provided.

Problem

When a syscall requests N bytes, RIPES currently processes only N/2 bytes.

Root cause

The read loop reduced lengthRequested on each iteration while growing myBuffer. Since the loop condition was myBuffer.size() < lengthRequested, both values converged toward the midpoint, causing the loop to terminate after processing only half the requested characters.

Fix

Removed the decrement of lengthRequested.

Testing

  • Verified with a minimal RISC-V program that requests a fixed number of characters.
  • Confirmed that the full requested input is now processed correctly.

Related issue

Fixes #432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read syscall consumes only half the expected number of characters

1 participant