cast to unsigned char and environmental var

m_sendmessage() and m_setinfo() parameters needs to be casted to unsigned char

environmental var $HOSTNAME gives localhost.localdomain
used regex ${HOSTNAME%.*} to just give localhost
however this doesn't work for #include... need set our own environment var