functionSource
stringlengths
20
97.4k
CWE-119
bool
2 classes
CWE-120
bool
2 classes
CWE-469
bool
2 classes
CWE-476
bool
2 classes
CWE-other
bool
2 classes
combine
int64
0
1
inherit(const DiagnosticContextStack& stack) { try { DiagnosticContextStack* ptr = getPtr(); delete ptr; ptr = new DiagnosticContextStack(stack); LOG4CPLUS_SET_THREAD_LOCAL_VALUE( threadLocal, ptr ); } catch(std::exception& e) { getLogLog().error( LOG4CPLUS_TEXT("ND...
false
false
false
false
false
0
bg_task_deliver_signals(struct bgtask *bt) { bg_task_check(bt); g_assert(bt->flags & TASK_F_RUNNING); /* * Stop when list is empty or task has exited. * * Note that it is possible for a task to enqueue another signal * whilst it is processing another. */ while (bt->signals != NULL) { GSList *lnk = bt-...
false
false
false
false
false
0
hashtable_create(int size, char flags, HashFunc hash_func, SizeFunc key_size, CopyFunc key_copy, HashEqualFunc key_equal, SizeFunc val_size, CopyFunc val_copy) { hashtable_t *hashtable; unsigned int i; hashtable = malloc(sizeof(*hashtable)); hashtable->hash = has...
false
true
false
false
false
1
ports_connected(void * context, uint64_t client1_id, uint64_t port1_id, uint64_t client2_id, uint64_t port2_id) { ladish_port_handle port1; ladish_port_handle port2; uint64_t connection_id; ladish_graph_handle vgraph1; ladish_graph_handle vgraph2; log_info("ports_connected %"PRIu64":%"PRIu64" %"PRIu64":%"P...
false
false
false
false
false
0
saveas_cb (GtkWidget * widget, gpointer user_data) { Ebook * ebook; ebook = (Ebook *)user_data; g_return_if_fail (ebook); if (ebook->filename) { g_free (ebook->filename); ebook->filename = NULL; } ebook->save_pdf = FALSE; save_txt_cb (widget, user_data); }
false
false
false
false
false
0
dl(const char *msg, u_long value) { /* * Two formats: if less than 10 million, display as the number, if * greater than 10 million display as ###M. */ if (value < 10000000) printf("%lu\t%s", value, msg); else printf("%luM\t%s", value / 1000000, msg); }
false
false
false
false
false
0
load_audio_out_driver (void) { xine_audio_port_t *audio_port; char **choices = get_driver_ids (xine_list_audio_output_plugins (xine)); /* try to init audio with stored information */ int i = xine_config_register_enum (xine, "audio.driver", 0, choices, _("audio driver to use"), N...
false
false
false
false
false
0
endElement (const char * name) { if (m_bStopped) return; flush_all (); if (m_nslength) if (strncmp (name,m_namespace,m_nslength) == 0) { if (*(name + m_nslength) == ':') name += m_nslength + 1; } UT_ASSERT (m_pListener || m_pExpertListener); if (m_pListener) m_pListener->endElement (nam...
false
false
false
false
false
0
os_live_obj() { int i; int n = 0; for (i = 0; i < heaps_used; i++) { RVALUE *p, *pend; p = heaps[i].slot; pend = p + heaps[i].limit; for (;p < pend; p++) { if (p->as.basic.flags) { switch (TYPE(p)) { case T_ICLASS: case T_VARMAP: case T_SCOPE: case T_NODE: continue; cas...
false
false
false
false
false
0
CL_GetFreeDLHandle (void) { dlhandle_t *dl; int i; for (i = 0; i < 4; i++) { dl = &cls.HTTPHandles[i]; if (!dl->queueEntry || dl->queueEntry->state == DLQ_STATE_DONE) return dl; } return NULL; }
false
false
false
false
false
0
bt_ctf_field_type_enumeration_add_mapping( struct bt_ctf_field_type *type, const char *string, int64_t range_start, int64_t range_end) { int ret = 0; GQuark mapping_name; struct enumeration_mapping *mapping; struct bt_ctf_field_type_enumeration *enumeration; struct range_overlap_query query; char *escaped_str...
false
false
false
false
false
0
local_id(id) ID id; { int i, max; if (lvtbl == 0) return Qfalse; for (i=3, max=lvtbl->cnt+1; i<max; i++) { if (lvtbl->tbl[i] == id) return Qtrue; } return Qfalse; }
false
false
false
false
false
0
goo_canvas_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { GooCanvas *canvas; GList *tmp_list; GooCanvasWidget *witem; g_return_if_fail (GOO_IS_CANVAS (container)); g_return_if_fail (callback != NULL); canvas = GOO_CAN...
false
false
false
false
false
0
GMT_normalize3v (double *a) { double r_length; r_length = GMT_mag3v(a); if (r_length != 0.0) { r_length = 1.0 / r_length; a[0] *= r_length; a[1] *= r_length; a[2] *= r_length; } }
false
false
false
false
false
0
CheckLabelFilterExclude(cmCTestTestProperties& it) { // if not using Labels to filter then return if (!this->UseExcludeLabelRegExpFlag ) { return; } // if there are no labels and we are excluding by labels // then do nothing as a no label can not be a match if(it.Labels.size() == 0 ) { ret...
false
false
false
false
false
0
server_sock_buff_data(const void *data0, size_t length, void *ctx) { const unsigned char *data = data0; struct uo_server *server = ctx; size_t consumed = 0; ssize_t nbytes; if (server->seed == 0 && data[0] == 0xef) { /* client 6.0.5.0 sends a "0xef" seed packet instead of the raw...
false
false
false
false
false
0
ReadFeature( json_object* poObj ) { CPLAssert( NULL != poObj ); CPLAssert( NULL != poLayer_ ); OGRFeature* poFeature = NULL; poFeature = new OGRFeature( poLayer_->GetLayerDefn() ); /* -------------------------------------------------------------------- */ /* Translate ESRIJSON "attributes" object...
false
false
false
false
false
0
syncinfo (dca_state_t * state, int * flags, int * sample_rate, int * bit_rate, int * frame_length) { int frame_size; /* Sync code */ bitstream_get (state, 32); /* Frame type */ bitstream_get (state, 1); /* Samples deficit */ bitstream_get (state, 5); /* CRC present ...
false
false
false
false
false
0
addFunctionComponentData(ecif_DllArg& da ,ecif_ElementComponent_X& tx) { tx.isFunction = true; tx.isCpp = da.is_cpp; tx.isF95 = da.is_f95; tx.isMatc = da.is_matc; update_dyna_string(tx.functionName, da.func); update_dyna_string(tx.libraryName, da.lib); tx.startVertex = da.start_vertex; tx.endVertex = ...
false
false
false
false
false
0
bnx2x_reload_if_running(struct net_device *dev) { struct bnx2x *bp = netdev_priv(dev); if (unlikely(!netif_running(dev))) return 0; bnx2x_nic_unload(bp, UNLOAD_NORMAL, true); return bnx2x_nic_load(bp, LOAD_NORMAL); }
false
false
false
false
false
0
qualify_attrname (const char *attrname, struct hv *flags) { char *res = NULL; char *pNS; size_t reslen; pNS = flags2namespace(flags); if (pNS) { reslen = strlen(pNS) + strlen(attrname) + 2; /* pNS + "." + attrname + nul */ res = malloc(reslen); } if (res) snprintf(res, reslen, "%s.%s", pNS...
false
false
false
false
false
0
FindResidue(const char *residue_name, int residue_sequence, int residue_insertion_code) const { // Check all residues for (int i = 0; i < NResidues(); i++) { PDBResidue *residue = Residue(i); if ((residue_sequence == residue->Sequence()) && (residue_insertion_code == residue->InsertionCode()) ...
false
false
false
false
false
0
vioutput(calltype_e type, int dest, unsigned int color_flags, const char *format, va_list ap) { char tempstr[maxtextlength]; int len; dccchat_t *chat; len = vsnprintf(tempstr,maxtextlength,format,ap); if ((len < 0) || (len >= maxtextlength)) { snprintf(tempstr, maxtextlength-1, "IOUTP...
true
true
false
false
true
1
match_limit() { try { // for error handling match(MATCH_LIMIT); limit_rate(); } catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) { if( inputState->guessing == 0 ) { reportError(ex); recover(ex,_tokenSet_5); } else { throw; } } }
false
false
false
false
false
0
dumpPassStructure(unsigned Offset) { llvm::dbgs() << std::string(Offset*2, ' ') << "BasicBlockPass Manager\n"; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { BasicBlockPass *BP = getContainedPass(Index); BP->dumpPassStructure(Offset + 1); dumpLastUses(BP, Offset+1); }...
false
false
false
false
false
0
ListDevices(ICECAdapter *parser) { cec_adapter_descriptor devices[10]; int8_t iDevicesFound = parser->DetectAdapters(devices, 10, NULL); if (iDevicesFound <= 0) { PrintToStdOut("Found devices: NONE"); } else { PrintToStdOut("Found devices: %d\n", iDevicesFound); for (int8_t iDevicePtr = 0; iD...
false
false
false
false
false
0
nyx_get_type(LVAL expr) { if (nyx_result_type != nyx_error) { return nyx_result_type; } nyx_result_type = nyx_error; if (expr == NULL) { return nyx_result_type; } switch (ntype(expr)) { case FIXNUM: nyx_result_type = nyx_int; break; case FLONUM: ...
false
false
false
false
false
0
operator<< (std::ostream& o, const GeometryEdge& A) { const int len = A.nodes.size(); o << A.tag << ' ' << len << ' '; for(int i = 0; i < len; ++i) { o << A.nodes[i]->tag << ' '; } o << std::endl; return o; }
false
false
false
false
false
0
setDisasm(Disassembler *d) { disasm = d; if (disasm) { int t; disasm->getOpcodeMetrics(t, max_opcode_length, t, t, t); } else { max_opcode_length = 1; } }
false
false
false
false
false
0
cubic_coef(spx_word16_t x, spx_word16_t interp[4]) { /* Compute interpolation coefficients. I'm not sure whether this corresponds to cubic interpolation but I know it's MMSE-optimal on a sinc */ spx_word16_t x2, x3; x2 = MULT16_16_P15(x, x); x3 = MULT16_16_P15(x, x2); interp[0] = PSHR32(MULT16_16(QCON...
false
false
false
false
false
0
isl_map_convex_hull(struct isl_map *map) { struct isl_basic_set *bset; struct isl_basic_map *model = NULL; struct isl_basic_set *affine_hull = NULL; struct isl_basic_map *convex_hull = NULL; struct isl_set *set = NULL; struct isl_ctx *ctx; if (!map) goto error; ctx = map->ctx; if (map->n == 0) { convex_h...
false
false
false
false
false
0
es_ttf_sizeUNICODE(sdl_data *sd, int len, char *buff) { char *bp, *start; Uint16 *text; int sendlen; TTF_Font *font; int res, w, h; bp = buff; POPGLPTR(font, bp); text = (Uint16 *) bp; res = TTF_SizeUNICODE(font, text, &w, &h); bp = start = sdl_get_temp_buff(sd, ...
false
false
false
false
false
0
krb5_decrypt_ticket(krb5_context context, Ticket *ticket, krb5_keyblock *key, EncTicketPart *out, krb5_flags flags) { EncTicketPart t; krb5_error_code ret; ret = decrypt_tkt_enc_part (context, key, &ticket->enc_part, &t); if (ret) return ret; { krb5_timestamp now; time_t ...
false
false
false
false
false
0
headers1( LIST * l, OBJECT * file, int rec, regexp * re[] ) { FILE * f; char buf[ 1024 ]; int i; static regexp * re_macros = 0; #ifdef OPT_IMPROVED_PATIENCE_EXT static int count = 0; ++count; if ( ( ( count == 100 ) || !( count % 1000 ) ) && DEBUG_MAKE ) { printf( "...patience.....
false
false
false
false
false
0
nmgr_load(NMGR *nmgr, int wmode){ CBLIST *list; const char *file; char path[URIBUFSIZ]; int i, err; assert(nmgr); sprintf(path, "%s%c%s", nmgr->rootdir, ESTPATHCHR, NODEDIR); if(!(list = cbdirlist(path))){ log_print(LL_ERROR, "loading the node directory failed"); return FALSE; } err = FALSE; ...
true
true
true
false
false
1
setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) { struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; if (keylen < cia->cia_min_keysize || keylen > cia->cia_max_keysize) { tfm->crt_flags |= CRYPT...
false
false
false
false
false
0
try_add_frags(struct inode *inode, unsigned frags) { unsigned size = frags * i_blocksize(inode); spin_lock(&inode->i_lock); __inode_add_bytes(inode, size); if (unlikely((u32)inode->i_blocks != inode->i_blocks)) { __inode_sub_bytes(inode, size); spin_unlock(&inode->i_lock); return false; } spin_unlock(&inode...
false
false
false
false
false
0
G_is_zero_value(void *rast, RASTER_MAP_TYPE data_type) { /* insert 0 check here */ return G_is_null_value(rast, data_type) || G_get_raster_value_d(rast, data_type) != 0.0 ? 0 : 1; }
false
false
false
false
false
0
set_no_answer_forward (unsigned delay, const std::string & uri) { forward_uri = uri; NoAnswerTimer.SetInterval (0, PMIN (delay, 60)); }
false
false
false
false
false
0
process(mail::imap &imapAccount, string &buffer) { if (eatEverything) return buffer.size(); size_t p=buffer.find('\n'); if (p == std::string::npos) { if (buffer.size() > 16000) return buffer.size() - 16000; // SANITY CHECK - DON'T LET HOSTILE SERVER DOS us return (0); } string buffer_cpy=buffer; b...
false
false
false
false
false
0
falcon_probe_nic_variant ( struct efab_nic *efab, struct pci_device *pci ) { efab_oword_t altera_build, nic_stat; int is_pcie, fpga_version; uint8_t revision; /* PCI revision */ pci_read_config_byte ( pci, PCI_CLASS_REVISION, &revision ); efab->pci_revision = revision; /* Asic vs FPGA */ falcon_read ( efab, &...
false
false
false
false
false
0
source_zip_verify(source_t *sourcep) { struct zip_source *zip_source = (struct zip_source *) sourcep; struct stat st; char buffer[1024]; FILE *filep; int n, percent, result; unsigned long long bytesRead = 0; if (sourcep != NULL) { result = stat(zip_source->path, &st); if (result == 0) ...
true
true
false
false
true
1
ast_frame_dump(const char *name, struct ast_frame *f, char *prefix) { const char noname[] = "unknown"; char ftype[40] = "Unknown Frametype"; char cft[80]; char subclass[40] = "Unknown Subclass"; char csub[80]; char moreinfo[40] = ""; char cn[60]; char cp[40]; char cmn[40]; if (!name) { name = noname; } ...
false
false
false
false
false
0
wdata_free(writer_data_t* data) { queue* elem, *tmp; QUEUE_FOR_EACH(&data->Q, elem, tmp) { waypoint* wpt = (waypoint*)elem; if (wpt->extra_data) { gpi_waypt_t* dt = (gpi_waypt_t*) wpt->extra_data; if (dt->addr_is_dynamic) { xfree(dt->addr); } xfree(dt); } waypt_free...
false
false
false
false
false
0
control(int in_link,struct atmtcp_control *msg) { OUT *out; int changed = 0; if (debug) fprintf(stderr,"Control: (%d.%d) %s %d.%d, vcc %s\n", ntohs(msg->hdr.vpi),ntohs(msg->hdr.vci), msg->type == ATMTCP_CTRL_OPEN ? "OPEN" : msg->type == ATMTCP_CTRL_CLOSE ? "CLOSE" : "???", msg->addr.sap_addr.v...
false
false
false
false
false
0
replace_suffix(const char *src_name, const char *suffix) { char *name; name = get_basename(src_name); if (name != NULL) { name = realloc(name, strlen(name) + strlen(suffix) + 1); strcat(name, suffix); } return name; }
false
false
false
false
false
0
arc_emac_poll(struct napi_struct *napi, int budget) { struct net_device *ndev = napi->dev; struct arc_emac_priv *priv = netdev_priv(ndev); unsigned int work_done; arc_emac_tx_clean(ndev); work_done = arc_emac_rx(ndev, budget); if (work_done < budget) { napi_complete(napi); arc_reg_or(priv, R_ENABLE, RXINT_M...
false
false
false
false
false
0
str2specialbuf(sp, buf, len) char_u *sp; char_u *buf; int len; { char_u *s; *buf = NUL; while (*sp) { s = str2special(&sp, FALSE); if ((int)(STRLEN(s) + STRLEN(buf)) < len) STRCAT(buf, s); } }
false
false
false
false
false
0
GrowTerrain(ARegionArray *pArr, int growOcean) { Awrite("Growing Terrain..."); for (int j=0; j<30; j++) { int x, y; for(x = 0; x < pArr->x; x++) { for(y = 0; y < pArr->y; y++) { ARegion *reg = pArr->GetRegion(x, y); if(!reg) continue; reg->population = 1; } } for(x = 0; x < pArr->x; x++) { ...
false
false
false
false
false
0
auth_oid(oid * it, size_t * len, const char *groupName, const char *prefix, int model, int level, const char *authtype) { int i; int itIndex = AUTH_OID_LEN; it[itIndex++] = strlen(groupName); for (i = 0; i < (int) strlen(groupName); i++) it[itIndex++] = groupN...
false
false
false
false
false
0
webx_image_to_pixbuf (gint image) { gint layer; layer = gimp_image_merge_visible_layers (image, GIMP_CLIP_TO_IMAGE); if (! gimp_drawable_is_rgb (layer)) gimp_image_convert_rgb (image); return webx_drawable_to_pixbuf (layer); }
false
false
false
false
false
0
import_dialog_destroy_cb (GtkWidget *widget, DialogData *data) { if (data->service != NULL) gth_task_completed (GTH_TASK (data->service), NULL); _g_object_unref (data->cancellable); _g_object_unref (data->service); _g_object_list_unref (data->photosets); _g_object_unref (data->photoset); _g_object_list_un...
false
false
false
false
false
0
free_buffer_locked (GstBuffer * buffer, void *data) { GSList **list = data; g_assert (buffer != NULL); *list = g_slist_prepend (*list, buffer); }
false
false
false
false
false
0
down_core8_2(gx_downscaler_t *ds, byte *outp, byte *in_buffer, int row, int plane, int span) { int x; int pad_white; b...
false
false
false
false
false
0
mem_segdown(p, q, child) thisperson *p, *q, *child; { boolean depend; int i; mem_initseg(p, q); if (!(child->loopdepend)) { depend = false; for(i=0; i<nchild; i++) if (childarray[i]->loopdepend) { depend = true; break; } depend = (depend || (p->loop...
false
false
false
false
false
0
rtc_load() { FILE *f; if (!rtc.batt) return; if (!(f = fopen(rtcfile, "r"))) return; rtc_load_internal(f); fclose(f); }
false
false
false
false
true
1
q_node_init (q_node_t *self) { if (NULL == self) { return QE_ASTNODEMEM; } self->id = ""; self->type = QNODE_NULL; self->prev = NULL; self->next = NULL; self->as.number = 0.0; self->as.string = ""; return 0; }
false
false
false
false
false
0
send_method_call(const char *dest, const char *path, const char *interface, const char *method, DBusPendingCallNotifyFunction cb, void *user_data, int type, ...) { DBusMessage *msg; DBusPendingCall *call; va_list args; ...
false
false
false
false
false
0
link_path_walk(const char *name, struct nameidata *nd) { int err; while (*name=='/') name++; if (!*name) return 0; /* At this point we know we have a real path component. */ for(;;) { u64 hash_len; int type; err = may_lookup(nd); if (err) return err; hash_len = hash_name(name); type = LAST...
false
false
false
false
false
0
setData(const QModelIndex &index, const QVariant &value, int role) { QStandardItem *item = QStandardItemModel::itemFromIndex(index); if(!item) return false; // do not warn when the item is checked if ( value == QVariant(Qt::Unchecked) && role == Qt::CheckStateRole) ...
false
false
false
false
false
0
opal_show_vhelp_internal(const char *filename, const char *topic, bool want_error_header, va_list arglist) { char *output; /* Convert it to a single string */ output = opal_show_help_vstring(filename, topic, want_error_header, arglist...
false
false
false
false
false
0
sconv(Format *format) { char *s = va_arg(format->args, char *); if ((format->flags & FMT_f1set) == 0) fmtcat(format, s); else { size_t len = strlen(s), width = format->f1 - len; if (format->flags & FMT_leftside) { fmtappend(format, s, len); pad(format, width, ' '); } else { pad(format, width, ' '); ...
false
false
false
false
false
0
find_guide_star_cb( GtkWidget *widget, gpointer window) { struct image_channel *i_ch; double x, y; GSList *sl = NULL; struct guider *guider; struct gui_star *gs = NULL; struct gui_star_list *gsl; int found = 0; gsl = gtk_object_get_data(GTK_OBJECT(window), "gui_star_list"); if (gsl != NULL) remove_stars_of...
false
false
false
false
false
0
FindAminoAcidAtomType(PDBAtom *atom) { // Check if a hetatm if (atom->IsHetAtom()) return PDB_NULL_ATOM; // Get residue PDBResidue *residue = atom->Residue(); if (!residue) return PDB_NULL_ATOM; // Get amino acid PDBAminoAcid *aminoacid = residue->AminoAcid(); if (!aminoacid) return PDB_NUL...
false
false
false
false
false
0
pack_struct(char *dest, char *src, int num, MPI_Datatype dtype) { int i, j; int blksize; /* size of block */ int extent; /* datatype extent */ int *len; /* lengths */ MPI_Aint *disp; /* displacements */ MPI_Datatype *type; /* datatypes */ char *s; /* ptr into source buffer */ extent = dtype->dt...
false
false
false
false
false
0
update_timer(struct Curl_multi *multi) { long timeout_ms; if (!multi->timer_cb) return 0; if ( multi_timeout(multi, &timeout_ms) != CURLM_OK ) return -1; if ( timeout_ms < 0 ) return 0; /* When multi_timeout() is done, multi->timetree points to the node with the * timeout we got the (relative)...
false
false
false
false
false
0
format_lines(char *dst, char *src, unsigned int len) { unsigned short *srcl = (unsigned short *)src; unsigned short *dstl = (unsigned short *)dst; unsigned int i, j; i = len / 32; len -= i * 32; dstl++; while(i--) { dstl += 3; dstl[ 0] = srcl[ 0]; dstl[ 3] = srcl[ 1]; dstl[ 6] = srcl[ 2]; dstl[ 9] = ...
false
false
false
false
false
0
method_81(const int *account, int *weight) { // exception "Ausnahme f. Sachkonten" if (9 == account[2]) return method_51_exception(account,weight); number2Array("0007654320", weight); weight[0] = 10; return algo01(11, weight, false, 10, account); }
false
false
false
false
false
0
getMetricBlock (decodeISF_t * pDecISF) { int err = OK; INT64 endPayload, value; /** * The METRIC_BLOCK tag consists of an MBUINT which represents the payload * size.\n * Its payload consists of one or many Metric Entries following each other.\n * This tag's payload consists of ...
false
false
false
false
false
0
xdr_reference(xdrs, pp, size, proc) register XDR *xdrs; char* *pp; /* the pointer to work on */ unsigned int size; /* size of the object pointed to */ xdrproc_t proc; /* xdr routine to handle the object */ { register char* loc = *pp; register bool_t stat; if (loc == NULL) switch (xdrs->x_op) { case...
false
false
false
false
false
0
HandlePoll(const CCECAdapterMessage &msg) { bool bIsError(msg.IsError()); cec_adapter_messagecode messageCode(msg.Message()); CLockObject lock(m_mutex); if (messageCode == MSGCODE_FRAME_START && msg.IsACK()) { m_lastPollDestination = msg.Destination(); if (msg.Destination() < CECDEVICE_BROADCAST) ...
false
false
false
false
false
0
setup_fonts() { load_font(_GK.large_font_string, &_GK.large_font, fail_large_font); load_font(_GK.normal_font_string, &_GK.normal_font, fail_normal_font); load_font(_GK.small_font_string, &_GK.small_font, fail_small_font); if (!_GK.large_font || !_GK.normal_font || !_GK.small_font) { g_print(_("Error: Could no...
false
false
false
false
false
0
FreeImage_Open(PluginNode *node, FreeImageIO *io, fi_handle handle, BOOL open_for_reading) { if (node->m_plugin->open_proc != NULL) { return node->m_plugin->open_proc(io, handle, open_for_reading); } return NULL; }
false
false
false
false
false
0
cstascii(struct result *presult, char *s) { register unsigned long val; register int r; register char delimit; val=0; delimit=*s; while (*++s != delimit) { if ( !isprint(*s) ) error("bad ascii constant"); r = *s; if ( r == '\\' ) switch(*++s) { case 't': r='\t'; break; case 'n': r='...
false
false
false
false
false
0
link_dev_buffers(struct page *page, struct buffer_head *head) { struct buffer_head *bh, *tail; bh = head; do { tail = bh; bh = bh->b_this_page; } while (bh); tail->b_this_page = head; attach_page_buffers(page, head); }
false
false
false
false
false
0
read_sum_head(int f, struct sum_struct *sum) { int32 max_blength = protocol_version < 30 ? OLD_MAX_BLOCK_SIZE : MAX_BLOCK_SIZE; sum->count = read_int(f); if (sum->count < 0) { rprintf(FERROR, "Invalid checksum count %ld [%s]\n", (long)sum->count, who_am_i()); exit_cleanup(RERR_PROTOCOL); } sum->blength = re...
false
false
false
false
false
0
write_char(unsigned int c, char * test_string, unsigned int cur_pos) { if (c < 0x80) { test_string[cur_pos] = c; cur_pos++; } else if (c < 0x800) { test_string[cur_pos] = (0xC0 | c>>6); test_string[cur_pos+1] = (0x80 | (c & 0x3F)); cur_pos += 2; } else if (c < 0x10000) { test_string[cu...
false
false
false
false
false
0
captcha_page(void){ time_t now = time(NULL); int q1, q2; if( atoi(PD("a","0")) == (atoi(PD("q1","-1")) + atoi(PD("q2","-1"))) ){ /* User gave the right answer. Set cookie and continue on. */ captcha_set_cookie(); cgi_redirect(PD("nxp","index")); return; } /* Note that we don't do _any_ c...
false
false
false
false
false
0
SHA384(const unsigned char *d, size_t n, unsigned char *md) { SHA512_CTX c; static unsigned char m[SHA384_DIGEST_LENGTH]; if (md == NULL) md=m; SHA384_Init(&c); SHA512_Update(&c,d,n); SHA512_Final(md,&c); OPENSSL_cleanse(&c,sizeof(c)); return(md); }
false
false
false
false
false
0
get_line(const char * prompt) { again: char * line; if (source.fp == NULL) { return NULL; } int fd = fileno(source.fp); if (!xboard && fd == 0 && isatty(0)) { #ifdef HAVE_READLINE line = get_line_readline(prompt); #else line = get_line_fgets(source.fp, prompt); #endif } else { line = get_line_fgets(sour...
false
false
false
false
false
0
e_modapi_init(E_Module *m) { Eina_List *ml, *cl, *zl; E_Manager *man; E_Container *con; E_Zone *zone; Ecore_X_Window *zones; int zcount = 0; /* check if illume is loaded and bail out if it is. * Illume1 and illume2 both cannot be loaded @ the same time */ if (e_module_find("illume")) retur...
false
false
false
false
true
1
parse_fastq_seqname(GtSeqIteratorFastQ *seqit, GtStr *buffer, char startchar, GtError *err) { char currentchar; bool firstsymbol = true; gt_error_check(err); gt_assert(seqit && buffer); gt_assert(...
false
false
false
false
false
0
sasl_auxprop_getctx(sasl_conn_t *conn) { sasl_server_conn_t *sconn; if(!conn || conn->type != SASL_CONN_SERVER) return NULL; sconn = (sasl_server_conn_t *)conn; return sconn->sparams->propctx; }
false
false
false
false
false
0
fini (void) { delete [] this->filename_; this->filename_ = 0; // Avoid double deletions. delete [] this->logger_key_; delete [] this->program_name_; if (this->reactor () && this->interval_ > 0 && this->max_size_ > 0) this->reactor ()->cancel_timer (this); return 0; }
false
false
false
false
false
0
__db_truncate_root(dbc, ppg, indx, pgnop, tlen, pgs_donep) DBC *dbc; PAGE *ppg; u_int32_t indx; db_pgno_t *pgnop; u_int32_t tlen; int *pgs_donep; { DB *dbp; DBT orig; PAGE *page; int ret, t_ret; db_pgno_t newpgno; dbp = dbc->dbp; DB_ASSERT(dbc->dbp->env, IS_DIRTY(ppg)); if ((ret = __memp_fget(dbp->mpf, ...
false
false
false
false
false
0
load_colormap(FILE *f, int verbose) { colormap_t cmap = {0, NULL}; int nalloc = 0; float r,g,b,a; int c; /* read initial comment lines, and echo if verbose */ do { while (isspace(c = fgetc(f))); if (c == '#' || c == '%') { while (isspace(c = fgetc(f)) && c != '\n' && c ...
false
false
true
false
true
1
numerize (char *syllable) { char *tmp; if ( (tmp = (char *)calloc(1, 4)) == NULL) err_sys_fatal("calloc"); if ( strlen (syllable) == 1 ) { (void) gen_rand_symbol(tmp, S_NB); (void)memcpy ((void *)syllable, (void *)tmp, 1); } free ((void *)tmp); }
false
false
false
false
false
0
wait_for_connections(void) { struct sockaddr_in myname; int sock=0; int flag=1; /* create a socket for listening */ sock=socket(AF_INET,SOCK_STREAM,0); /* exit if we couldn't create the socket */ if(sock<0){ syslog(LOG_ERR,"Network server socket ...
false
false
false
false
false
0
processcompl_compat(struct async *as, void __user * __user *arg) { struct urb *urb = as->urb; struct usbdevfs_urb32 __user *userurb = as->userurb; void __user *addr = as->userurb; unsigned int i; compute_isochronous_actual_length(urb); if (as->userbuffer && urb->actual_length) { if (copy_urb_data_to_user(as->u...
false
false
false
false
false
0
mov_read_ftyp(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { uint32_t type = get_le32(pb); if (type != MKTAG('q','t',' ',' ')) c->isom = 1; av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type); get_be32(pb); /* minor version */ url_fskip(pb, atom.size - 8); ...
false
false
false
false
false
0
vivid_vbi_gen_sliced(struct vivid_vbi_gen_data *vbi, bool is_60hz, unsigned seqnr) { struct v4l2_sliced_vbi_data *data0 = vbi->data; struct v4l2_sliced_vbi_data *data1 = vbi->data + 1; unsigned frame = seqnr % 60; memset(vbi->data, 0, sizeof(vbi->data)); if (!is_60hz) { unsigned i; for (i = 0; i <= 11; i+...
false
false
false
false
false
0
ctcp_register(const char *name) { CTCP_CMD_REC *rec; rec = ctcp_cmd_find(name); if (rec == NULL) { rec = g_new0(CTCP_CMD_REC, 1); rec->name = g_ascii_strup(name, -1); ctcp_cmds = g_slist_append(ctcp_cmds, rec); } rec->refcount++; }
false
false
false
false
false
0
r2cfII_7(R *R0, R *R1, R *Cr, R *Ci, stride rs, stride csr, stride csi, INT v, INT ivs, INT ovs) { DK(KP900968867, +0.900968867902419126236102319507445051165919162); DK(KP222520933, +0.222520933956314404288902564496794759466355569); DK(KP623489801, +0.623489801858733530525004884004239810632274731); ...
false
false
false
false
false
0
casinl(long double complex z) { long double complex w; long double x, y, b; static long double complex ca, ct, zz, z2; x = creall(z); y = cimagl(z); if (y == 0.0L) { if (fabsl(x) > 1.0L) { w = PIO2L + 0.0L * I; /*mtherr( "casinl", DOMAIN );*/ } else { w = asinl(x) + 0.0L * I; } return (w); }...
false
false
false
false
false
0
_read(int fd, iobuffer *iobuf, void *buffer, size_t len, int timeout) { int copied = 0, rc, i; fd_set fds; struct timeval tv; memset(buffer, 0, len); while((copied < len)) { i = MIN(iobuf->level, len - copied); memcpy(buffer + copied, iobuf->buffer + IO_BUFFER - iobuf->level, i); ...
false
true
false
false
true
1
gst_clock_slave_callback (GstClock * master, GstClockTime time, GstClockID id, GstClock * clock) { GstClockTime stime, mtime; gdouble r_squared; stime = gst_clock_get_internal_time (clock); mtime = gst_clock_get_time (master); GST_CAT_DEBUG_OBJECT (GST_CAT_CLOCK, clock, "master %" GST_TIME_FORMAT ...
false
false
false
false
false
0
PrintName(Object* name) { if (name->IsString()) { String* str = String::cast(name); if (str->length() > 0) { Put(str); } else { Add("/* anonymous */"); } } else { Add("%o", name); } }
false
false
false
false
false
0
spif_tok_show(spif_tok_t self, spif_charptr_t name, spif_str_t buff, size_t indent) { spif_char_t tmp[4096]; if (SPIF_TOK_ISNULL(self)) { SPIF_OBJ_SHOW_NULL(tok, name, buff, indent, tmp); return buff; } memset(tmp, ' ', indent); snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - ...
false
false
false
false
false
0
runOnFunction(Function &F) { bool Changed = false; auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F); SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE(); DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree(); NewDestAlignments.clear(); NewSrcAlignments.clear(); for (auto &...
false
false
false
false
false
0
set_graph_palette_from_string (int i, const char *s) { int err = 0; if (i >= 0 && i < N_GP_COLORS) { unsigned int x[3]; if (sscanf(s + 1, "%02x%02x%02x", &x[0], &x[1], &x[2]) == 3) { user_color[i].r = x[0]; user_color[i].g = x[1]; user_color[i].b = x[2]; } else { err = 1; } } else ...
false
false
false
false
false
0