음.. 어쩌다가 내 블로그가 이쪽 방향으로 흘러가는지 모르겠지만서도.. ^^

오늘은 무엇을 했냐하면..
fork 방식의 게이트웨이를 thread 방식으로 전환하면서
기존 라이브러리에서 데이터 파싱에 오류가 생겼다.

분명 입력한 데이터는 동일한데
처리를 못하겠다고 에러를 내 놓는거다.

로직을 따라따라 가다보니 strtok 가 문듯 의심스러워보인다.
언제나처럼 구글링을 감행...

strtok는 쓰레드에 안전하지 않다고 하네.
하긴 그냥 보기에도 그렇지.
두번째 파싱할때부터 인자로는 NULL 을 쓰는데 그건 내부적으로 뭔가 저장하고 있다는거 아니겠어.
이런건 닥치기 전까지는 생각못하는 것들이지..

그래서 기존 strtok 를 strtok_r 로 변경했다.

참.. string.h 이건 항상 중요하다.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void main()
{
    char    *token, *ptr, *last;
    char    seps[] = ",";
    int token_count;
    char *pszMessage = "SIMPLE,LIFE,IS,BEST";

    token_count = 0;
    token = strtok_r(pszMessage, seps, &last);
    while ( token != NULL )
    {
        printf("STEP [%02d][%s]\n", token_count, token);
        token = strtok_r(NULL, seps, &last);
        token_count++;
    }
}


크리에이티브 커먼즈 라이센스
Creative Commons License
2008/06/04 18:50 2008/06/04 18:50

Trackback URL : http://simplelife.pe.kr/tc/trackback/549

  1. # Coconut Oil 2018/10/24 21:00 Delete Reply

    Spot on with this write-up, I seriously believe that
    this website needs a great deal more attention. I'll probably
    be back again to read more, thanks for the information!

  2. # mice gaming 2018/10/30 15:00 Delete Reply

    "I've heard tech whiff shared :
    "Setup was easy, the mouse looked very responsive and worked fantastic.
    It wasn't reliably registering when I was holding down the assigned change button in conjunction with a keyboard press.

    I am not sure whether it had to do with having the principal mouse buttons also or
    adjusting the polling speed. The mouse has been put on high performance (instead of
    endurance) mode."

  3. # gaming Monitor 2018/10/30 15:02 Delete Reply

    I am an expert video editor and I play a lot of matches in my free time.
    I have read the gaming screen reviews on tech whiff, and I purchased it.
    This screen is ideal for me. The true colors allow me to edit movie with no worry, and
    also the 144 hz is fantastic for gaming.

  4. # ??? ????? open sky 777 hd 2018/10/31 23:53 Delete Reply

    I am curious to find out what blog platform you have been using?

    I'm experiencing some minor security problems with my latest blog and I'd like to find something
    more risk-free. Do you have any recommendations?

  5. # casino slot game finder 2018/11/02 11:09 Delete Reply

    It's great that you are getting ideas from this article
    as well as from our dialogue made at this place.

  6. # amazon casino slot games 2018/11/07 17:29 Delete Reply

    What is a Google slap, and ways to avoid Google slap?
    Of the to your benefit - make use of keywords as 'Alt' tag words.

    These sites will an individual to rank higher.

  7. # pb 2018/11/09 05:09 Delete Reply

    It offers you by using a specific set of audiences. There are many web site solutions should you not
    know how to do it yourself. These methods will drive more
    visitors to your online store.

  8. # Quest Bars 2018/11/09 20:53 Delete Reply

    Hello There. I found your blog using msn. This is an extremely
    well written article. I'll make sure to bookmark it and come back to
    read more of your useful info. Thanks for the post.
    I will definitely return.

  9. # Sling TV 2018/11/11 16:09 Delete Reply

    Have you ever thought about including a little bit more than just your articles?
    I mean, what you say is fundamental and all. But imagine if you added some great images or videos to
    give your posts more, "pop"! Your content is excellent but with images and videos, this website could undeniably be one of the best in its
    niche. Fantastic blog!

  10. # limitlessbands.com 2018/11/12 04:24 Delete Reply

    Hello, Neat post. There is an issue along with your website in web explorer, might check this?
    IE nonetheless is the market chief and a good portion of other folks
    will miss your fantastic writing due to this problem.

  11. # What Equipment is Needed for Sling TV 2018/11/14 07:28 Delete Reply

    I do not even know how I ended up here, but I thought this post was good.
    I don't know who you are but certainly you are going to a famous blogger if you are not
    already ;) Cheers!

Leave a comment

« Previous : 1 : ... 114 : 115 : 116 : 117 : 118 : 119 : 120 : 121 : 122 : ... 504 : Next »

뚜는 지금.. 사랑해사랑해
아.. 열심히 살자..
남자B형염소자리인천

Categories

전체 (504)
뚜.. 서툰.. (258)
폰 이야기 (13)
나의 길 (85)
읽을거리 (21)
사진갤러리 (124)

Recent Posts

  1. Android Studio 2.2 에서 layout 미리...
  2. mac 에서 ssh 접속시 한글 입력이 안될때.
  3. Android Studio. Zxing 라이브러리 사...
  4. 안드로이드 프로젝트를 SVN 등록시 bin...
  5. 안드로이드에서 android.annotation 를...

Recent Comments

  1. Clear your mind of any negative thou... slot mobile shop nigeria 15:27
  2. hello there and thank you for your i... Platinum Essentials Forskolin Extract 15:04
  3. Awesome blog! Is your theme custom m... Fat Loss 4 Idiots - 5 Ways have To B... 14:47
  4. Hey there, I think your blog might b... Xtreme Growth 03:29
  5. Hello.This article was extremely rem... Slim Ultimate 11/17

Recent Trackbacks

Bookmarks

  1. ATOMOS
  2. c3cc3's Homepage
  3. 봄실
  4. 우중산보... 그 싱그러운 여유

1158

907

google chart api graph

-30 days

today : 717

Site Stats

TOTAL 673955 HIT
TODAY 717 HIT
YESTERDAY 1069 HIT