Click here to Skip to main content
13,000,469 members (52,901 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I downloaded libyahoo2 and I'm trying to login but get a segmentation fault when the yahoo_login() function is called. Here's the code I'm using:

#include <stdio.h>
#include <liblyahoo2/yahoo2.h>
#include <libyahoo2/yahoo2_callbacks.h>
int main(int argc, char **argv)
    int id;
    id = yahoo_init(argv[1], argv[2]);
    yahoo_login(id, 0);  //this is where I get the seg fault
    return 0;

I've been all over google and haven't found a solution
Posted 12-Oct-12 16:09pm
Chuck O'Toole 12-Oct-12 22:38pm
What are the command line arguments? Are you sure there are two of them, "Username" and "password". A null for either will cause a crash, you should check in the code for either argv[1] or argv[2] being null before using them to protect against bad command line invocation.
doughyi8u 12-Oct-12 22:48pm
yes, there's only two args to yahoo_init(username, password). I've even tried using a call like:
yahoo_init("username", "password");
Andrewpeter 12-Oct-12 22:38pm
What is prototype of yahoo_login() function?
doughyi8u 12-Oct-12 22:54pm
yahoo_login(int id, ENUMERATION_TYPE);

where id is the return value of init_yahoo("username", "password") and ENUMERATION TYPE is a value called from enum yahoo_status. 0 is AVAILABLE and should work according to
Richard MacCutchan 13-Oct-12 3:19am
What is the value of id on return from yahoo_init()?
doughyi8u 13-Oct-12 7:35am
Richard MacCutchan 13-Oct-12 11:48am
I think you forgot to code the callback routines. You need to check the documentation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170624.1 | Last Updated 12 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100