title: Issue with sqlite in c
body: <p>Today I've got a segmentation fault when I tried this:</p>
  
  <pre><code>int n=1;
  sprintf(sql,"SELECT * FROM QUEST WHERE ID_Q= %d;",n);
  printf("%s\n",sql);
  rc=sqlite3_exec(db,sql,callback,0,&amp;errmsg);
  </code></pre>
  
  <p>It doesn't even print sql.</p>
  
  <p>But before I tried this it worked:</p>
  
  <pre><code>sql="SELECT * FROM QUEST;";
  rc=sqlite3_exec(db,sql,callback,0,&amp;errmsg);
  </code></pre>
  
  <p>If you have any idea what could be, please share.
  Thanks in advance</p>
  
  <p>Later edit: the whole code is here: <a href="https://github.com/byradu/database/blob/master/testing2.c" rel="nofollow noreferrer">https://github.com/byradu/database/blob/master/testing2.c</a></p>