title: curl: (23) Failed writing body (675 != 8240) why?
body: <p>i have  a problem with curl curl, i want take a result of shell command (is  very long result ) the  curl command  is</p>
  <pre><code>curl -H &quot;X-MBX-APIKEY: --- MY API KEY HERE ---&quot;   -X 'GET' 'https://api.binance.com/api/v3/historicalTrades?symbol=BNBUSDT&amp;limit=500'
  </code></pre>
  <p>if  i run this command by shell work perfect , but if i run it by curl return
  this is my code curl: (23) Failed writing body (675 != 8240),  why ?</p>
  <pre><code>    if (RING_API_PARACOUNT != 1) {
              RING_API_ERROR(RING_API_MISS1PARA);
              return;
          }
          if ( ! RING_API_ISSTRING(1) ) {
              RING_API_ERROR(RING_API_BADPARATYPE);
              return;
          }
      const char *UrlSpec = &quot;/trades&quot;;
      const char *SymbolSqUry = &quot;?symbol=&quot;;
      const char *SymblSQry = RING_API_GETSTRING(1);   
      const char *SymbolCloseQry = &quot;&amp;limit=&quot;;
      const char *miniCanapini = &quot;\'&quot;;
      char CrossSymbl[20] = {0};
      char CossLmt[10] = {0};
      char *result;
      FILE *read_fp;
      char buffer[BUFSIZ +1];
      int chars_read;
      memset(buffer, '\0',sizeof(buffer));
      sscanf(SymblSQry,&quot;%[a-zA-Z ];%[0-9 ]&quot;,CrossSymbl ,CossLmt);
      size_t sz = strlen(cmDOriG)  + strlen(OptioNncURL_g) +strlen(OptioNncURL_GET) + strlen(miniCanapini) + strlen(UrlApi)+ strlen(UrlApiV3) + strlen(UrlSpec) + strlen(SymbolSqUry) \
                  + strlen(CrossSymbl)  +strlen(SymbolCloseQry)+strlen(CossLmt) + strlen(miniCanapini)   + 1;
      char destination[sz];
      strcpy(destination, cmDOriG);
      strcat(destination, OptioNncURL_g);
      strcat(destination, OptioNncURL_GET);
      strcat(destination, miniCanapini);
      strcat(destination, UrlApi);
      strcat(destination, UrlApiV3);
      strcat(destination, UrlSpec);
      strcat(destination, SymbolSqUry);
      strcat(destination, CrossSymbl);
      strcat(destination, SymbolCloseQry);
      strcat(destination, CossLmt);
      strcat(destination, miniCanapini);
      const char* mode = &quot;r&quot;;
      read_fp=popen(destination, mode);
      if (read_fp != NULL)
         {
                chars_read = fread(buffer,sizeof(char),BUFSIZ,read_fp);
                if (chars_read &gt; 0)
                {
                }
                pclose(read_fp);
         }          
      RING_API_RETSTRING(buffer);
  </code></pre>