File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -62,18 +62,19 @@ void prepareHostname(char* hostname)
6262 hostname[pos] = ' -' ;
6363 pos++;
6464 }
65- // else do nothing - no leading hyphens and do not include hyphens for all other characters.
66- pC++;
67- }
68- // if the hostname is left blank, use the mac address/default mdns name
69- if (pos < 6 ) {
70- sprintf (hostname + 5 , " %*s" , 6 , escapedMac.c_str () + 6 );
71- } else { // last character must not be hyphen
72- while (pos > 0 && hostname[pos - 1 ] == ' - ' ) {
73- hostname[pos -1 ] = 0 ;
74- pos-- ;
75- }
65+ // else do nothing - no leading hyphens and do not include hyphens for all other characters.
66+ pC++;
67+ }
68+ // if the hostname is left blank, use the mac address/default mdns name
69+ if (pos < 6 ) {
70+ sprintf (hostname + 5 , " %*s" , 6 , escapedMac.c_str () + 6 );
71+ } else { // last character must not be hyphen
72+ hostname[pos] = ' \0 ' ; // terminate string
73+ while (pos > 0 && hostname[pos -1 ] == ' - ' ) {
74+ hostname[ pos - 1 ] = ' \0 ' ;
75+ pos--;
7676 }
77+ }
7778}
7879
7980// handle Ethernet connection event
You can’t perform that action at this time.
0 commit comments