Skip to content

Conversation

@EricCarrGH
Copy link
Contributor

  • Removed macro redefined warnings
  • Reverted make block for mac. Not needed.
  • Fix longstanding memory corruption bug, where CMOC writes a 16 bit enum value at an 8 bit location, overflowing to the next byte in memory. The following sample program illustrates the problem:
#include <coco.h>
#include "fujinet-fuji.h"

// First variable of program. It resides in the memory immediately following the fujinet-lib "ak_appkey_size" variable
char firstVar[] = "ABC";

int main(void)
{   
    // Prints: 41 42 43 : ABC
    printf("%02x %02x %02x : %s\n",firstVar[0], firstVar[1], firstVar[2], firstVar);
    
    fuji_set_appkey_details(0xffff, 0x1, DEFAULT);
    
    // Prints: 00 42 43 :     (without fix - first byte set to 0)
    // Prints: 41 42 43 : ABC (with fix)
    printf("%02x %02x %02x : %s\n",firstVar[0], firstVar[1], firstVar[2], firstVar);
    
    while (1);
}

Copy link
Contributor

@tschak909 tschak909 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tschak909 tschak909 merged commit f3bb0a0 into FujiNetWIFI:main Nov 16, 2025
9 checks passed
@EricCarrGH EricCarrGH deleted the coco-fix branch November 16, 2025 15:07
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.

2 participants