bugAVR C Runtime Library - Bugs: bug #9669, Incorrect example for strings in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #9669: Incorrect example for strings in flash

Submitter:  None
Submitted:  Fri 16 Jul 2004 02:42:46 PM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  None Assigned to:  joerg_wunsch
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Wed 21 Jul 2004 09:56:27 PM UTC, comment #1: 

A fixed FAQ entry has been committed to both, HEAD of CVS,
as well as the avr-libc-1_0-branch.

Joerg Wunsch <joerg_wunsch>
Group administrator
Fri 16 Jul 2004 02:42:46 PM UTC, 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);
//------------------------------------


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-07-21 joerg_wunsch Open/ClosedOpen Closed
2004-07-20 joerg_wunsch Assigned toNone joerg_wunsch

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code