Listing 1. smssend Program

void main(int argc, char **argv)
{
       sprintf(end_sign, "%c", 26);
            /* add ctrl-z to variable end_sign */
       strcpy(message, "at+cmgs=\"")
       strcat(message, argv[1]);
       strcat(message, "\"\r");
       strcat(message, argv[2]);
       strcat(message, end_sign);
            /*add end_sign to string to
              end the message */
       port = read_cfgfile("PORT");
       socket = initialize_socket(port);
       command(socket, message);
            /* send message to socket*/
       close(socket)
}