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

 
 

bug #9669: Incorrect example for strings in flash

Submitted by:  None
Submitted on:  Fri 16 Jul 2004 02:42:46 PM UTC  
 
Category: DocumentationSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NonePercent Complete: 0%
Assigned to: Joerg Wunsch <joerg_wunsch>Originator Email: -unavailable-
Open/Closed: ClosedRelease: None
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 21 Jul 2004 09:56:27 PM UTCjoerg_wunschOpen/ClosedOpen=>Closed
Tue 20 Jul 2004 09:45:11 PM UTCjoerg_wunschAssigned toNone=>joerg_wunsch

Back to the top


Powered by Savane 3.1-cleanup1