Open ChriszGitHub opened 8 years ago
I think you need to declare a buffer for title and subtitle then use strcpy to copy command line data to this buffer.
struct s_opts
{
int oled;
int verbose;
char title[64];
char subtitle[64];
} ;
then
case 't': strcpy(opts.title, optarg); break;
case 's': strcpy(opts.subtitle, optarg); break;
Hello Hallard,
thanks for fast response.
Mhhh, not work... I don't understand why...
root@raspberrypi:/usr/local/src/ArduiPi_OLED/examples# ./string_demo -v -o 3
Segmentation fault
root@raspberrypi:/usr/local/src/ArduiPi_OLED/examples# ./string_demo -v -o 3 -t 'title' -s 'subtitle'
Segmentation fault
Edit: I update the code in the first posting...
Hello Hallard,
do you have a other idea for me...? very very thanks...
Hi,
first, my C++ know-how is not good. I will edit the oled_demo.cpp for setting Title and Subtitle Parameters. Why the Script runs in a Seqfault ?