-
Notifications
You must be signed in to change notification settings - Fork 25
birthday/date implementation #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I’m reviewing this PR. |
natyhl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun feature and great idea! You could add a --help flag wit brief description of what "birthday" does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would maybe try to make the .md file more organized and easy to read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: could handle wrong format input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the birthday and date command documentation for clarity and added examples.
|
I'm reviewing this PR |
|
I think this is a really cool concept to add a birthday command. Just as a heads up in birthdaytest.c line 19 it looks like the comment got cut off (" return status; // status = childs exit numbe") I'm assuming you meant to state number, but cleaning that up would be great! Otherwise super clean and you did an amazing job! |
|
1️⃣ Verification — Requirements & Functionality Purpose: Core features checked: birthday --help → Shows usage information. birthday -s MM/DD → Sets birthday (accepts valid dates). birthday → Displays either “Happy Birthday!” or “Uh oh, it’s not your birthday yet :(”. Handles missing or invalid arguments by showing usage text. System date retrieved properly via date. ✅ All functional requirements are implemented and operate as intended under normal conditions. 2️⃣ Testing — Behavior and Edge Cases Test Case Command Expected Result Observed Result Status Summary: 3️⃣ Issues Identified & Possible Causes Description: Observed Pattern: Error appears randomly after 1–3 consecutive runs. Later executions succeed without recompilation. The executable file remains intact (ls shows same size). Possible Root Causes: Stack or buffer overflow when copying the MM/DD string in the -s path (e.g., fixed-length array too small or missing '\0'). Memory corruption of argv/cmd buffer in user space that temporarily breaks shell command execution. Less likely but possible minor race between file writes and shell read of the same block in the xv6 filesystem. Severity: Moderate — does not affect functionality persistently but shows unstable memory behavior. Suggested Fix (Conceptual): Use safe string functions such as strncpy or snprintf, allocate enough space for null terminators, and validate input length. When using birthday -s MM/DD, the program provides no explicit feedback that the date was stored. Invalid dates (e.g., 13/40) are not accepted which is good, but without warning, only Usage: displays. 4️⃣ Code Walkthrough — Logic & Readability Argument handling is clear and well structured. Output strings and help messages are user-friendly. ASCII art output is neatly formatted and adds creativity. Code is easy to read, though some string handling is likely unsafe. No explicit comments describe the storage mechanism or input length limits. Improvement Suggestions: Add inline comments around argument parsing and birthday setting logic. Use constants for buffer sizes and date formats to avoid magic numbers. 5️⃣ Final Checklist
Reviewer Summary The birthday command successfully meets its functional requirements and runs within FogOS without crashes in normal use. |
|
I like this idea, it's a fun project. There are two different "usages", you should just have one. For the --help flag, maybe either add an implementation of strcmp so you don't need to check each char manually, or reconfigure it so the flag is just 4.9/5 +0.1 -> minor fixes above. |
This pull request addresses issue #8. Not only does it add a birthday command, but it also adds a date command.
Birthday is a command that must be set before calling with valid parameters 'birthday -s MM/DD'. After the command is set, simply type 'birthday' and you will either receive a happy birthday message with ASCII art from https://www.asciiart.eu/ or a message saying its not your birthday yet.
Date is a singular command. Type 'date' and you will receive today's date in format MMM DD HH:MM:SS PDT YYYY. MMM is a string.
Documentation and testing suggestions can be found in docs/birthday-date.md