summaryrefslogtreecommitdiffstats
path: root/src/proto/nmb.c
diff options
context:
space:
mode:
authorMichael Brown2005-05-24 01:47:54 +0200
committerMichael Brown2005-05-24 01:47:54 +0200
commit7b423c098838fb4b972ac888ac6f94efda951765 (patch)
treec55dbb81000afe6e556caf9004ff830116117c36 /src/proto/nmb.c
parentSplit PXE code into preboot, udp, tftp, undi and loader units. (diff)
downloadipxe-7b423c098838fb4b972ac888ac6f94efda951765.tar.gz
ipxe-7b423c098838fb4b972ac888ac6f94efda951765.tar.xz
ipxe-7b423c098838fb4b972ac888ac6f94efda951765.zip
Fixes for gcc >= 3.2 from Georg Baum
Diffstat (limited to 'src/proto/nmb.c')
-rw-r--r--src/proto/nmb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/proto/nmb.c b/src/proto/nmb.c
index b395dabeb..d44c06850 100644
--- a/src/proto/nmb.c
+++ b/src/proto/nmb.c
@@ -15,6 +15,7 @@ static inline char * nbns_make_name ( char *dest, const char *name ) {
char nb_name[16];
char c;
int i;
+ uint16_t *d;
*(dest++) = 32; /* Length is always 32 */
@@ -26,11 +27,13 @@ static inline char * nbns_make_name ( char *dest, const char *name ) {
memset ( nb_name, ' ', 15 );
nb_name[15] = '\0';
memcpy ( nb_name, name, strlen ( name ) ); /* Do not copy NUL */
+
+ d = ( uint16_t * ) dest;
for ( i = 0 ; i < 16 ; i++ ) {
c = nb_name[i];
- *( ( ( uint16_t * ) dest ) ++ ) =
- htons ( ( ( c | ( c << 4 ) ) & 0x0f0f ) + 0x4141 );
+ *( d++ ) = htons ( ( ( c | ( c << 4 ) ) & 0x0f0f ) + 0x4141 );
}
+ dest = ( char * ) d;
*(dest++) = 0; /* Terminating 0-length name component */
return dest;