[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] [bugs #9669] Incorrect example for strings in flash
From: |
anonymous |
Subject: |
[avr-libc-dev] [bugs #9669] Incorrect example for strings in flash |
Date: |
Fri, 16 Jul 2004 10:46:06 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 Galeon/1.3.13 |
This mail is an automated notification from the bugs tracker
of the project: AVR C Runtime Library.
/**************************************************************************/
[bugs #9669] Full Item Snapshot:
URL: <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=9669>
Project: AVR C Runtime Library
Submitted by: 0
On: Fri 07/16/2004 at 10:42
Category: Documentation
Severity: 5 - Average
Item Group: None
Resolution: None
Assigned to: None
Originator Email: address@hidden
Status: Open
Summary: Incorrect example for strings in flash
Original Submission: The code in the FAQ entry "How do I put an array of
strings completely in ROM?" is incorrect. Array elements are not read the right
way (note that the array of pointers resides in flash).
Here is a working solution. Instead of:
//------------------------------------
strcpy_P (buf, array[1]);
//------------------------------------
Should be:
//------------------------------------
PGM_P p;
memcpy_P( &p, &array[1], sizeof(PGM_P));
strcpy_P (buf, p);
//------------------------------------
For detailed info, follow this link:
<http://savannah.nongnu.org/bugs/?func=detailitem&item_id=9669>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [avr-libc-dev] [bugs #9669] Incorrect example for strings in flash,
anonymous <=