Changeset e499a30 in mainline for test/print/print1/test.c
- Timestamp:
- 2006-05-02T11:25:22Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6445baf
- Parents:
- 7dd1787
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/print/print1/test.c
r7dd1787 re499a30 29 29 #include <test.h> 30 30 31 #define BUFFER_SIZE 32 32 31 33 void test(void) 32 34 { 33 35 __native nat = 0x12345678u; 36 37 unsigned char buffer[BUFFER_SIZE]; 38 34 39 printf(" Printf test \n"); 35 40 … … 47 52 48 53 printf(" Print to NULL '%s'\n",NULL); 54 55 printf("Print short text to %d char long buffer via snprintf.\n", BUFFER_SIZE); 56 snprintf(buffer, BUFFER_SIZE, "Short %s", "text"); 57 printf("Result is: '%s'\n", buffer); 58 59 printf("Print long text to %d char long buffer via snprintf.\n", BUFFER_SIZE); 60 snprintf(buffer, BUFFER_SIZE, "Very long %s. This text`s length is more than %d. We are interested in the result.", "text" , BUFFER_SIZE); 61 printf("Result is: '%s'\n", buffer); 62 49 63 return; 50 64 }
Note:
See TracChangeset
for help on using the changeset viewer.